On Sunday, June 9, 2002, at 05:57 , Tor Hildrum wrote:
[..]
> $target=~s/\(.+?\)//gi;
>
> print "$target\n";
>
> [localhost:~/Programming/Perl/Various code] tor% ./greedy
> micheal  john
> [localhost:~/Programming/Perl/Various code] tor%
>
> This does however produce 2 spaces between the two names. So, you might 
> also
> want to match the extra space before or after the parentheses.
[..]

My complements on the effective use of '?' - I'm still finding
out where that works to do which.... So I have put together a
couple of variations on a theme at:

http://www.wetware.com/drieux/pbl/RegEx/greedyVnotgreedy.txt

I fear folks leap too quickly to using a '.+' to grab anything
rather than taking he time to buy the perl 5 pocket reference
and getting in touch with their inner regular expressions....

ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to