/*
判断是否价格
*/
let money = "100.98"
let parrern = "^\\d+(\\.\\d{0,2})?$"
if NSPredicate(format: "SELF MATCHS %@",pattern).evaluate(with:money){
print("是价格")
}else{
print("不是价格")
}

  

swift5 正则简单使用的更多相关文章

  1. Python正则简单实例分析

    Python正则简单实例分析 本文实例讲述了Python正则简单用法.分享给大家供大家参考,具体如下: 悄悄打入公司内部UED的一个Python爱好者小众群,前两天一位牛人发了条消息: 小的测试题:  ...

  2. javascript正则简单入门

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  3. 正则简单操作cookie、url search

    正则操作cookie.url getCookie function getCookie(key) { var cookies = window.document.cookie, reg = new R ...

  4. python之re正则简单够用

    0. 1.参考 Python正则表达式指南 https://docs.python.org/2/library/re.html https://docs.python.org/2/howto/rege ...

  5. C# 中的正则简单例子

    public static void Main() { Regex rgx = new Regex(@"[S|s]et-[C|c]ookie: (?<cookieName>\w+ ...

  6. java 正则简单使用

    查找是否包含字串 查询是否包含 #{name} 片段 这里有包含所以返回true String context = "select * from t_user where (name = # ...

  7. Python爬虫10-页面解析数据提取思路方法与简单正则应用

    GitHub代码练习地址:正则1:https://github.com/Neo-ML/PythonPractice/blob/master/SpiderPrac15_RE1.py 正则2:match. ...

  8. python浅谈正则的常用方法

    python浅谈正则的常用方法覆盖范围70%以上 上一次很多朋友写文字屏蔽说到要用正则表达,其实不是我不想用(我正则用得不是很多,看过我之前爬虫的都知道,我直接用BeautifulSoup的网页标签去 ...

  9. python re 正则

    *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* ...

随机推荐

  1. SQL Server 2008R2 代理服务-开启

    ,点击开始菜单-所有程序-SQLServer2008R2-配置工具-SQLServer配置管理器 2,选择SQLServer服务 3,找到SqlServer代理(MSSQLSERVER),双击或右键选 ...

  2. 浅析android中的依赖注入

    这几年针对Android推出了不少View注入框架,例如ButterKnife.我们首先来了解一下使用这些框架有什么好处,其实好处很明显:它可以减少大量的findViewById以及setOnClic ...

  3. the art of seo(chapter ten)

    Mobile, Local, and Vertical SEO ***The Mobile Landscape***Mobile site speed:• Google Page Speed Insi ...

  4. &&、||和&、|的区别

    1. && .|| 和 &.| 都是逻辑运算符,前两个 与后两个的区别就在于 &&.|| 有"短路"现象,而& .| 则没有. 例如 ...

  5. ES搜索排序,文档相关度评分介绍——Field-length norm

    Field-length norm How long is the field? The shorter the field, the higher the weight. If a term app ...

  6. mvc 让伪静态变得简单

    IIS 部署后访问*.* config 配置: <modules runAllManagedModulesForAllRequests="true">      < ...

  7. 解决Linux Kettle出现闪退问题

    linux环境, 运行sh spoon.sh打开图形化界面时经常出现闪退情况. 报错信息如下: cfgbuilder - Warning: The configuration parameter [o ...

  8. arm-linux-gcc4.4.3编译busybox-1.25.0

    系统环境: 1.操作系统:Ubuntu16.04 2.交叉编译工具链:arm-linux-gcc4.4.3 3.busybox源码包:busybox-1.25.0 一.修改Makefile配置 首先解 ...

  9. java-01

    二,八,十六进制到十进制的转换方法: 十进制到二,八,十六进制的转换方法: 2:标识符(掌握) (1)就是给类,接口,方法,变量等起名字的字符序列 (2)组成规则: A:英文大小写字母 B:数字 C: ...

  10. Confd 配置指导

    Quick Start Guide Before we begin be sure to download and install confd. Select a backend confd supp ...