On Fri, Feb 8, 2013 at 4:43 AM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > Ian Kelly wrote: > Surely that depends on the size of the pattern, and the size of the data > being worked on.
Natually. > Compiling the pattern "s[ai]t" doesn't take that much work, it's only six > characters and very simple. Applying it to: > > "sazsid"*1000000 + "sat" > > on the other hand may be a tad expensive. > > Sweeping generalities about the cost of compiling regexes versus searching > with them are risky. I was referring to the specific timing measurements I made earlier in this thread, not generalizing. -- http://mail.python.org/mailman/listinfo/python-list