python - Strange reg output -
i using regular expression identify days of week , have following regular expression
(?:mon(?:(?:.)?|(?:day)?)|tue(?:(?:.)?|(?:sday)?))
my test file contains
monday mon mon.
when run code recognizes mond
, mon
, , mon.
. why not recognizes monday
? appreciated.
i'm using python 2.7.6
your regex fauly actually. try simplified regex:
(?:mon|tue(?:s)?)[.]?(?:day)?
Comments
Post a Comment