Tim Peters added the comment:
Without re.IGNORECASE, the leading
^[_a-z0-9-]+
can't even match the first character (`val` starts with uppercase Z), so it
fails instantly.
With re.IGNORECASE, it's not "stuck", but is taking a verry long time to
try an enormous number of (ultimately
Sateesh Kumar added the comment:
@SilentGhost, You are right, when I pass the flag "re.IGNORECASE" for example
in Variant-2 the python process do gets stuck.
Here is the revised code for Variant-2:
* Variant-2
%cat match.py
import re
pattern =
"^[_a-z0-9-]+([\.'_a-z0-9-]+)*@[a-z0-9]+([\.a