Message189434
Non-greedy matching actually makes things worse :-)
$ ./python -m timeit -s "import re; pat = re.compile('\A*a*a*a\Z'.replace('*', '[^.]+'), re.IGNORECASE)" "pat.match('a' * 100 +'z')"
100 loops, best of 3: 3.31 msec per loop
$ ./python -m timeit -s "import re; pat = re.compile('\A*a*a*a\Z'.replace('*', '[^.]+?'), re.IGNORECASE)" "pat.match('a' * 100 +'z')"
100 loops, best of 3: 6.91 msec per loop |
|
Date |
User |
Action |
Args |
2013-05-17 09:23:16 | pitrou | set | recipients:
+ pitrou, lemburg, tim.peters, georg.brandl, gregory.p.smith, vstinner, christian.heimes, timehorse, Arfrever, iankko, bkabrda, fweimer, mpessas |
2013-05-17 09:23:16 | pitrou | set | messageid: <1368782596.37.0.813766361391.issue17980@psf.upfronthosting.co.za> |
2013-05-17 09:23:16 | pitrou | link | issue17980 messages |
2013-05-17 09:23:16 | pitrou | create | |
|