Compilation flags
When compiling a pattern string into a pattern object, it's possible to modify the standard behavior of the patterns. In order to do that, we have to use the compilation flags. These can be combined using the bitwise OR "|
".
Flag |
Python |
Description |
---|---|---|
|
2.x 3.x |
The pattern will match lower case and upper case. |
|
2.x 3.x |
This flag changes the behavior of two metacharacters:
|
|
2.x 3.x |
The metacharacter " |
|
2.x 3.x |
This flag makes \w, \W, \b, \B, \s, and \S dependent on the current locale. "re.LOCALE just passes the character to the underlying C library. It really only works on bytestrings which have 1 byte per character. UTF... |