Python RE

\d     - Digit (0-9)
\D     - Not a Digit (0-9)
\w     - Word Character (a-z, A-Z, 0-9, _)
\W     - Not a word Character
\s     - Whitespace (space, tab, \n)
\S     - Not Whitespace
\b     - Word Boundary
\B     - Not a word Boundary 

.      - Any Character Except New Line
^      - Beginning of a String
$      - End of a String
[]     - Matches Characters in brackets
[^]    - Matches Characters Not in brackets
()     - Group
|      - Either or

Quantifiers:
*      - 0 or More
+      - 1 or More
?      - 0 or One
{3}    - Exact Number
{3,4}  - Range of Numbers (Minimum,Maximum)

Flags:
I      - Ignore case
M      - Multiline
...

猜你喜欢

转载自www.cnblogs.com/z-joshua/p/9178485.html