Re: How to avoid this greedy match?



"JWK" == John W Krahn <krahnj@xxxxxxxxx> writes:

JWK> I seem to remember that Jeffrey Friedl's[1] book describes a way to
JWK> emulate left and right word boundaries in Perl's regular expressions.

that shouldn't be too hard with lookbehind/lookahead. just look one way
for \w and the other way for \W. the ordering of the two will make it a
left or right word boundary. but i don't see the need for left/right. if
you use a word regex somewhere, the a \b before it is left and \b after
it is right. there really isn't a need for left vs right boundaries IMO
and no one has complained louldy that perl only has \b.

uri

--
Uri Guttman ------ uri@xxxxxxxxxxxxxxx -------- http://www.sysarch.com --
----- Perl Architecture, Development, Training, Support, Code Review ------
----------- Search or Offer Perl Jobs ----- http://jobs.perl.org ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
.