in reply to How Greedy is Greedy: A Regex Question
The original poster complains that when he uses (.*?) for the second parentheses, it doesn't work properly. What should be used is (.?) without the asterisk.<a href="http://www.perlmonks.org">Perlmonks</a> is a great site, so i +s <a href="http://www.devshed.com">DevShed</a> $string =~ m%<a href="([^"]+)">(.*)</a>%;
-Spenser
That's Spenser, with an "s" like the detective.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How Greedy is Greedy: A Regex Question
by dsb (Chaplain) on Apr 25, 2007 at 14:00 UTC |