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
In reply to Re: Regex becomes greedy with /s
by Corion
in thread Regex becomes greedy with /s
by pingo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |