The re.ASCII is relevant to the byte patterns only. It makes the \w, \W,\b, \B, \d, \D, and \S perform ASCII-only matching instead of full Unicode matching.
re.DEBUG
N/A
N/A
The re.DEBUG shows the debug information of compiled pattern.
re.IGNORECASE
re.I
?i
perform case-insensitive matching. It means that the [A-Z] will also match lowercase letters.
re.LOCALE
re.L
?L
The re.LOCALE is relevant only to the byte pattern. It makes the \w, \W, \b, \B and case-sensitive matching dependent on the current locale. The re.LOCALE is not compatible with the re.ASCII flag.
re.MUTILINE
re.M
?m
The re.MULTILINE makes the ^ matches at the beginning of a string and at the beginning of each line and $ matches at the end of a string and at the end of each line.
re.DOTALL
re.S
?s
By default, the dot (.) matches any characters except a newline. The re.DOTALL makes the dot (.) matches all characters including a newline.
re.VERBOSE
re.X
?x
The re.VERBOSE flag allows you to organize a pattern into logical sections visually and add comments.
Leave a Reply