in reply to Re: Parsing and searching HTML code
in thread Parsing and searching HTML code

I thought that if strings are contained in variables then they don't need to quoted. Also one question Kenosis, in this statement /(\Q$search_start\E.*?\Q$search_end\E)/s;, I realized that the ? after the .* is important. What does it do?

Replies are listed 'Best First'.
Re^3: Parsing and searching HTML code
by Kenosis (Priest) on Jul 26, 2012 at 18:02 UTC

    That prevents the regex from being greedy, else the match would end at the very last $search_end--way beyond what you wanted.