Question:
In Python, I can compile a regular expression to be case-insensitive usingre.compile
:re.compile
. I can’t find anything like Perl’s i
suffix (e.g. m/test/i
) in the documentation.Best Answer:
Passre.IGNORECASE
to the flags
param of search
, match
, or sub
:If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com
Leave a Review