Re: avoiding greedy match..

2002-06-09 Thread drieux
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 name

Re: avoiding greedy match..

2002-06-09 Thread Tor Hildrum
> BlankHi everyone, > > I need some help for preventing greedy match..I want to get rid of the > words in paranthesis in the below text. When i use the code below i loose ' > john ' because it matches the last ' )' after recovery.. Is there a easy > way to avoid this?.. > > > $target='michea

avoiding greedy match..

2002-06-09 Thread Huseyin Tac
BlankHi everyone, I need some help for preventing greedy match..I want to get rid of the words in paranthesis in the below text. When i use the code below i loose ' john ' because it matches the last ' )' after recovery.. Is there a easy way to avoid this?.. $target='micheal (fields) john