Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python regex flags

re.A | re.ASCII			Perform ASCII-only matching instead of full Unicode matching

re.I | re.IGNORECASE	Perform case-insensitive matching

re.M | re.MULTILINE		^ matches the pattern at beginning of the string and each newline’s beginning (
).
               			$ matches pattern at the end of the string and the end of each new line (
)

re.S | re.DOTALL		Without this flag, DOT(.) will match anything except a newline

re.X | re.VERBOSE 		Allow comment in the regex

re.L | re.LOCALE		Perform case-insensitive matching dependent on the current locale. Use only with bytes patterns
Source by pynative.com #
 
PREVIOUS NEXT
Tagged: #python #regex #flags
ADD COMMENT
Topic
Name
6+4 =