//g:global全局匹配
Chectsheet | |
---|---|
. | any character except newline(表示除了换行以外的其他所有字符) |
\w\d\s\S | word, digit, whitespace(文字、数字、空格、非空格) |
[abc] | any of a, b, or c |
[^abc] | not a, b, or c |
^abc$ | start / end of the string (行首出现a,行尾出现c) |
[a-g] | character between a & g |
(abc) | capture group |
.* | 贪婪匹配 |
.*? | 非贪婪匹配 |