Metacharacter | Description |
---|---|
/ | Begins and ends the regular expression |
. | Matches any single character except the newline |
element* | Matches element zero or more times |
element+ | Matches element one or more times |
element? | Matches element zero or one time |
[characters] | Matches a character out of those contained within the brackets |
[^characters] | Matches a single character that is not contained within the brackets |
(regex) | Treats the regex as a group for counting or a following *, +, or ? |
left|right | Matches either left or right |
[l–r] | Matches a range of characters between l and r |
^ | Requires match to be at the string’s start |
$ | Requires match to be at the string’s end |
\b | Matches a word boundary |
\B | Matches where there is not a word boundary |
\d | Matches a single digit |
\D | Matches a single nondigit |
\n | Matches a newline character |
\s | Matches a whitespace character |
\S | Matches a nonwhitespace character |
\t | Matches a tab character |
\w | Matches a word character (a-z, A-Z, 0-9, and _) |
\W | Matches a nonword character (anything but a-z, A-Z, 0-9, and _) |
\x | x (useful if x is a metacharacter, but you really want x) |
{n} | Matches exactly n times |
{n,} | Matches n times or more |
{min,max} | Matches at least min and at most max times |
Regular Expression
文章名称:《Regular Expression》
文章链接:https://www.orzzone.com/regular-expression.html
商业联系:yakima.public@gmail.com
本站大部分文章为原创或编译而来,对于本站版权文章,未经许可不得用于商业目的,非商业性转载请以链接形式标注原文出处。
本站内容仅供个人学习交流,不做为任何投资、建议的参考依据,因此产生的问题需自行承担。
文章链接:https://www.orzzone.com/regular-expression.html
商业联系:yakima.public@gmail.com
本站大部分文章为原创或编译而来,对于本站版权文章,未经许可不得用于商业目的,非商业性转载请以链接形式标注原文出处。
本站内容仅供个人学习交流,不做为任何投资、建议的参考依据,因此产生的问题需自行承担。
相关推荐
- 前端入门非典型指南
- 使用不同的方法来创建对象和生成原型链
- 按钮点击回调的节流处理
- Vue防快速连击指令&权限指令的坑
- 公共请求的封装
- 如何在老项目里推行ESLint代码风格检测
- Avoid replacing instance root $data. Use nested data properties instead
- webpack4项目优化实战
- 前端技术选型可能会考虑的一些点
- 从零搭建一个前端项目
- Element-UI中Select下拉框组件添加虚拟列表
- 前端高端岗位面试总结
- 编译要1小时的Webpack项目优化思路和条件编译方案
- node和浏览器环境下同一段代码输出结果不同
- 识别webpack路径别名(alias)
- lin-cms-koa源码阅读之:目录结构
- lin-cms-koa源码阅读之:入口和启动
- 如何高亮模版代码
- TypeError: Attempted to assign to readonly property
- 混合APP内本地H5资源包增量包缩包实践总结