1.
如\d?,代表出现0个或1个数字
2.
如\d+?,代表最小贪婪,满足\d+的最小匹配,也就是只出现一个数字最好
3.
(?<name> expression) 命名的捕获组
4.
(?: expression),匹配该捕获组的内容,但是不保存该组
5.
(?<=Expression) 逆序肯定环视,表示所在位置左侧能够匹配Expression
(?<!Expression) 逆序否定环视,表示所在位置左侧不能匹配Expression
(?=Expression) 顺序肯定环视,表示所在位置右侧能够匹配Expression
(?!Expression) 顺序否定环视,表示所在位置右侧不能匹配Expression
6.
(?imsx-imsx:pattern) 其中imsx-imsx是标志修饰符
m Treat string as multiple lines. That is, change "^" and "$" from matching the start or end of the string to matching the start or end of any line anywhere within the string.
s Treat string as single line. That is, change "." to match any character whatsoever, even a newline, which normally it would not match. Used together, as /ms, they let the "." match any character whatsoever, while still allowing "^" and "$" to match, respectively, just after and just before newlines within the string.
i Do case-insensitive pattern matching. If use locale is in effect, the case map is taken from the current locale. See perllocale.
x Extend your pattern's legibility by permitting whitespace and comments.
p Preserve the string matched such that ${^PREMATCH}, ${^MATCH}, and ${^POSTMATCH} are available for use after matching.
g and c Global matching, and keep the Current position after failed matching. Unlike i, m, s and x, these two flags affect the way the regex is used rather than the regex itself. See "Using regular expressions in Perl" in perlretut for further explanation of the g and c modifiers.