in reply to Matching HTML Comments
A quick fix would be to change .+ to .+?.
You can read more about this issue in perldoc perlre.