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
最新评论
大哥资深网民啊,01年我还在念小学。。
看着有点难过。。。
嘿嘿,谢谢老哥,也祝老哥事业蒸蒸日上。
我是你唯一的药学类友情链接网站。 作为一个80后的过来人祝福你,生活越来越好。
这篇文章,我们中学那会老师课堂上念给我们听的。
哈哈哈哈哈,没想到啊, 我有手抄版
嗯,是的
好心办坏事多了去啦
哈哈,是的,我15年末来上海写代码了,一晃三年多过去了,好快。
今天看QQ好友的时候突然看到了你的名字,想起几年前在药品国际注册群挺活跃/厉害的你,现在不见踪影了。就搜了一下,没想到你现在转行去写代码了... (刚才打漏了一句话...)