in reply to Keep file formatted
and do the join on the line above with an empty string ('' instead of ' ').$text =~ s/\n/ /g;
I don't know if you have any reasons for doing any of these things, but I couldn't see any offhand. That the substituted things could span several lines doesn't seem to fit with both that join and the substituion, but if it does, you could alter your regexps to something like:
Which would deal with the possibilities of newlines and/or normal space between A/an and <STRONG>.$text =~ s/A\/an(\s+)<STRONG>(a|e|i|o|u)/An$1<STRONG>$2/g;
I will let others point out that you should look into module X for this kind of thing - I really agree, but felt more like answering this question. :)
Btw: Shouldn't that be "A/An" in that regexp, instead of "A/an"?
|
|---|