in reply to How to use a regex to parse html form tags

You ought to use something like HTML::Parser for that. It is notoriously difficult to decode html with regular expressions.

That said, your problem is limited enough that your approach will probably work once you tell the regex engine to substitute globally. Do that by using the /g modifier to the substitution, as well as /s. I'm not sure you need /m but I don't think it does any harm.

$intext =~ s/$orgtext/$newtext/gims;
I also made it ignore case in matching, just in case.

After Compline,
Zaxo