Beginner's performance problem

Sean 'Shaleh' Perry shalehperry at attbi.com
Fri Apr 12 03:33:02 EDT 2002


> 
> Aha! I'd put off reading up on the regular expression stuff until later as 
> I thought it just did searches, as opposed to also doing in-place 
> replaces. Half an hour spent on the HOW-TO and I'm a lot better informed. 
> Add a couple of r'\b' to the above, and I ought to be laughing. 
> 

test and triple test your \bfoo\b regex's.  They sometimes mean things you did
not realize.  For instance re.compile(r'\bengine') would match 'regex-engine'.





More information about the Python-list mailing list