in reply to Regex becomes greedy with /s
It's not that the .+? becomes greedy, it's that /s allows dot to match newlines. Thus, the leftmost match can start earlier. Maybe you want to use HTML::LinkExtor or an HTML parser, or maybe even Web::Scraper, or even HTML::Selector::XPath
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex becomes greedy with /s
by pingo (Hermit) on Feb 26, 2010 at 10:24 UTC | |
by AnomalousMonk (Archbishop) on Feb 26, 2010 at 23:35 UTC |