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

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