in reply to substitution issue
Are ^M two chars (ie. ^ and M) or just a visual representation of \r byte (ie. CR)? From the first part of the substitution /\^[A-Z]/ I see you think that are two bytes, but if it's always a M, why are you seeking for the whole alphabet?
BTW, your code is replacing ^M after </Content> because your flag is not reset by this closing tag.
|
|---|