Even corion's regex will fail if there is a newline anywhere between the tags. This can easily be fixed with the /s modifier, but are there are probably more special cases yet to be found. Use a proven module.
Bill
Comment on Re^2: Global matching not working as expected