in reply to Re: Perl's regexp (?{...}) construct and constraining matches.
in thread Perl's regexp (?{...}) construct and constraining matches.
Thanks diotalevi, I was struggling to come up with guaranteed failure condition. \w\b\w works, but your solution is more elegant.
Implementing your suggestions, the regexp now looks like:
m/$find(?(?{not(pos()<=length($_)*.5)})(?!))/
Starting to look a little saner.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl's regexp (?{...}) construct and constraining matches.
by Aristotle (Chancellor) on Aug 14, 2004 at 19:26 UTC | |
|
Re^3: Perl's regexp (?{...}) construct and constraining matches.
by diotalevi (Canon) on Aug 16, 2004 at 12:25 UTC |