On Mar 16, 2005, at 5:32 PM, Sean Perry wrote:
I know this does not directly help, but I have never successfully used \b in my regexs. I always end up writing something like foo\s+bar or something more intense.

I've had luck with the boundary flag in relation to lookbehinds. For example, if I wanted to only match after "int" (and not "print") (?<=\bint) seems to work fine. I'm a bit frustrated at not being able to find a simple way to have a search stop after eating up one word. You'd think the \b would do it, but nope.




_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to