The stupid question is the question not asked | |
PerlMonks |
Re: Using Look-ahead and Look-behindby jds17 (Pilgrim) |
on May 07, 2009 at 16:13 UTC ( [id://762651]=note: print w/replies, xml ) | Need Help?? |
Thank you for your very nice article, I certainly learned some new tricks! Just one little comment: The code in the last paragraph did not work because by default regular expressions are greedy. (Did this change with the Perl versions in between?) The only right-substring that comes out is the full string: Output: Making the "(.*)" part non-greedy fixes it (in Perl 5.10): Output:
In Section
Tutorials
|
|