in reply to Help with Regex

Try this
1. Use ungreedy (.*?)
2. Treat the whole string as one line. use /s
my ($new_source) = $source =~ /<!-- InstanceBeginEditable name="guts" +-->(.*?)<!-- InstanceEndEditable -->/s;
instead of
my ($new_source) = $source =~ /<!-- InstanceBeginEditable name="guts" +-->(.*)<!-- InstanceEndEditable -->/;