html js 正则表达式语法大全,js正则表达式语法大全(JS regular expression syntax Daquan).doc...
js正则表达式语法大全(JS regular expression syntax Daquan)
js正则表达式语法大全(JS regular expression syntax Daquan)
regular expression syntax
A regular expression is a text pattern consisting of regular characters (such as characters a to Z) and special characters (called meta characters). This pattern describes one or more strings to match when searching for a text body. A regular expression, as a template, matches a character pattern with the string it searches for.
Here are some examples of regular expressions that might be encountered:
JScript VBScript matching
/^\[\t]*$/ "^\[\t]*$, a blank line.
/\d{2}-\d{5}/ "\d{2}-\d{5}" verifies whether a ID number is made up of a 2 digit number, a hyphen, and a 5 digit number.
/ (. *) ">.*/" (. *) >.*, a HTML marker.
The following table is a complete list of meta characters and their behavior in the context of regular expressions:
Character description
Mark the next character as a special character, or a literal character, or a backward reference, or an octal escape character. For example, the'n'matches the character "n"". '\n'matches a newline character. Sequence matching "\" and \ \ '\ ("," (".
Matches the start position of the input string. If you set the Multiline attribute of the RegExp object, ^ matches the position after'\n'or'\r'.
$matches the end position of the input string. If the Multiline property of the RegExp object is set, $matches the location before'\n'or'\r'.
* matches the previous sub expression zero or more times. For example, zo* can match "Z" and "zoo"". * equivalent to {0}.
+ matches the previous sub expression one or more times. For example,'zo+'matches "Zo" and "zoo", but does not match "Z"". + is equivalent to {1}.
Matches the previous sub expression zero or twice. For example, "do (ES)" can match the "do" in "do" or "does"". Equivalent to {0,1}?.
{n} n is a nonnegative integer. Match the specified n times. For example,'o{2}'does not match the'o' in Bob, but it matches the two o in food.
{n,} n is a nonnegative integer. Match at least n times. For exa
html js 正则表达式语法大全,js正则表达式语法大全(JS regular expression syntax Daquan).doc...相关推荐
- Perl Regular Expression Syntax Perl的正则表达式语法
Perl Regular Expression Syntax Perl的正则表达式语法 Synopsis 摘要 The Perl regular expression syntax is base ...
- java正则开头结尾_以m开头以d结尾的正则表达式-正则表达式以什么开头-正则表达式不以0开头...
正则表达式:数字开头中间字母结尾数字 如果你的结尾数字是多个也可以的话,你就要再加上一个+号,另外,中间的字母允许大写幺?允许的话要再加上A-Z,所以你可以改这样试试: "^[0-9]+[a ...
- 10、正则表达式 (笔试题、语法规则、正则对象方法、正则实例属性、支持正则表达式的String对象的方法、贪婪匹配与非贪婪匹配)
正则表达式 目录 10.1 语法规则 10.1.1 创建方法 1.直接量 2.构造方法RegExp() 10.1.2 三个属性i,g,m 10.1.3 方括号 10.1.4 元字符 10.1.5 量词 ...
- js进阶正则表达式方括号(方括号作用)(js正则是在双正斜杠之中:/[a-z]/g)...
js进阶正则表达式方括号(方括号作用)(js正则是在双正斜杠之中:/[a-z]/g) 一.总结 方括号:范围 圆括号:选 大括号:数量 1.js正则是在双正斜杠之中: var reg2=/[a-z]/ ...
- js正则贪婪模式_C# 正则表达式贪婪模式案例
案例一. 如 "acbacb" 正则 "a.*?b" 只会取到第一个"acb" 原本可以全部取到但加了限定符后,只会匹配尽可能少的字符 ...
- eclipse加速之禁用JS、jsp等文件的语法验证
eclipse加速之禁用JS.jsp等文件的语法验证 去除eclipse的JS验证: 将windows->preference->Java Script->Validator-> ...
- Js基础引导(二)——语法
朋友,你好. 欢迎进入JS基础引导--语法篇,本篇内容是JS的基本概念(常识) 语法: JS语法大量借鉴了其他C语言或者类C语言(如java),因此,熟悉这些语言对于学习JS会很轻松,同样的,会了JS ...
- JS中的BOM、正则表达式、定时器
一.BOM 浏览器对象模型 (BOM-Browser Object Model) 使 JavaScript 有能力与浏览器"对话". 由于现代浏览器已经(几乎)实现了 JavaSc ...
- js 最新手机号码、电话号码正则表达式
js最新手机号码.电话号码正则表达式 正则表达式(regular expression)是一个描述字符模式的对象.使用JavaScript正则表达式可以进行强大的模式匹配和文本检索与替换功能. 手机号 ...
最新文章
- ecshop模板的原理分析
- 物联网白皮书【2018】重磅发布|今年的物联网产业交出了一张怎样的答卷
- mpvue+vant app搭建微信小程序
- Windows下配置sphinx+reStructuredText详解
- php redis新增数据类型,Redis有哪几种数据类型
- mysql 终端模拟_mysql客户端模拟脏读、幻读和可重复读
- Coding and Paper Letter(二)
- 服务器产品的特质和优势,亿速云裸金属服务器兼具“弹性”和“裸金属”两种属性,既有虚拟机的弹性,同时又保留了裸金属的一切性能、特性和优势!...
- 一站式学习Wireshark(三):应用Wireshark IO图形工具分析数据流
- java基于ssm医院病历管理系统
- “CSIG 计算机视觉前沿 · 研讨会”于6月28日在百度举行
- Contrastive Learning
- Monkey详解(脚本篇---获取坐标)
- 2022年安全员-B证考试题库及安全员-B证模拟试题
- QQ留言代码,网页QQ留言
- 2022年上半年信息系统项目管理师上午客观题参考答案及解析(四)
- leaflet实现风场流动
- 数据降维的几种方法(转)
- Cache(缓存)基本概念
- 【Git配置技巧】01. 配置文件git config介绍
热门文章
- 四、DOM-事件高级
- 做有声播客月赚5.9万?37岁大叔公开分享自己的经验帮你学习
- Win8系统安装教程【附Win8/64位系统下载地址】
- alter table XXXX drop partition xxxx 不释放存储空间问题
- Android Studio VT-x is disabled in BIOS 的解决办法
- linux 三剑客之grep
- thinkpad e430c + ubuntu 电脑降温措施
- 两个HC-05蓝牙模块互相绑定构成无线串口模块 1
- php解析rss格式新闻源,订阅一些RSS新闻源来阅读电子报纸
- 经典卷积网络学习----FCN(图像分割)