语法:
句点字符:
匹配除换行符 \n 之外的任何单字符。要匹配 . ,请使用 \. 。

表达式:
...\.
具体字符:

排除字符

字符范围
\w 匹配字母、数字、下划线。等价于 [A-Za-z0-9_]
重复字符
{min, max} 至少匹配min 次,至多匹配max次

量词(必须跟前导字符)
* Zero or more repetitions
+ One or more repetitions.
选择字符
? Optional character

空白字符
\s Any One Whitespace
\S Any One Non-whitespace character

匹配行
start and the end of the line
^ (hat) and $ (dollar sign)
捕获字符组
(...) Capture Group

选择字符组
(abc|def) Matches abc or def
全选字符
进阶用法:
元字符:
\b单词边界
匹配一个单词边界,也就是指单词和空格间的位置。
例如, 'er\b' 可以匹配"never" 中的 'er',但不能匹配 "verb" 中的 'er'。
\B非单词边界
匹配非单词边界。
'er\B' 能匹配 "verb" 中的 'er',但不能匹配 "never" 中的 'er'。
场景:
1.至少包含3个a
'\b.*a.*a.*a.*\b'
分析: .*代表任意个任意字符