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)? 

online demo: http://regex101.com/r/jc2iw3


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -