It's all about
connecting the dots

Regular Expression

Summary of Metacharacters in Regular Expression
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
[lr] 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
赞(0) 打赏
版权声明:非商业用途转载请注明文章链接,商业用途转载请联系邮箱获取授权。
文章名称:《Regular Expression》
文章链接:https://www.orzzone.com/regular-expression.html
商业联系:yakima.public@gmail.com
本站内容仅供个人学习交流,不做为任何投资、建议的参考依据,因此产生的问题需自行承担。

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏