in reply to Regular Expn Problem
update: Here's a simple demonstration -- compare the outputs of these two commands:
For me, the first one prints "onefour", and the second just prints "one". (Anyway, I think I prefer Roy Johnson's approach.)perl -e '$_ = "one two three four"; print $1,$2,$/ if (/(one) .+?(?: t +hree (four))/)' perl -e '$_ = "one two three four"; print $1,$2,$/ if (/(one) .+?(?: t +hree (four))?/)'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regular Expn Problem
by venkatr_n (Sexton) on May 10, 2004 at 06:00 UTC |