PHP - Manual: Character classes
2024-11-13
Sequence | Description |
---|---|
[...] | A single character listed or contained within a listed range. Ranges can be combined with the {+} and {-} operators. For example [a-z]{+}[0-9] is the same as [0-9a-z] and [a-z]{-}[aeiou] is the same as [b-df-hj-np-tv-z] . |
[^...] | A single character not listed and not contained within a listed range. |
. | Any character, default [^\n]. |
\d | Digit character, [0-9] . |
\D | Non-digit character, [^0-9] . |
\s | White space character, [ \t\n\r\f\v] . |
\S | Non-white space character, [^ \t\n\r\f\v] . |
\w | Word character, [a-zA-Z0-9_] . |
\W | Non-word character, [^a-zA-Z0-9_] . |
官方地址:https://www.php.net/manual/en/parle.regex.charclass.php