[Tutor] stopping greedy matches

Mike Hall michael.hall at critterpixstudios.com
Thu Mar 17 19:36:24 CET 2005


On Mar 16, 2005, at 8:32 PM, Kent Johnson wrote:
> "in (.*?)\b" will match against "in " because you use .* which will 
> match an empty string. Try "in (.+?)\b" (or "(?<=\bin)..+?\b" )to 
> require one character after the space.
>>
Another working example, excellent. I'm not too clear on why the back 
to back ".." in "(?<=\bin)..+?\b" )" makes the regex work, but it does.

>
> You can't import it, you have to run it from the command line. I don't 
> know if it is installed under Mac OSX though. You might be interested 
> in RegexPlor:
> http://python.net/~gherman/RegexPlor.html
>

RegexPlor looks fantastic, will be downloading. Thanks.



More information about the Tutor mailing list