I am having a text file having some text to be remove enclosed within a defined tag and send an email with the modified text.
To accomplish this, I am using a regex and replacing the text enclosed within the tags (–) with “”. But, this approach removes the empty lines (paragraph change) as well.
To prevent this, I am using pre html tag before sending the email. it preserves the empty lines (paragraph change) but, it also preserve the empty line created as part of text replacement with “”
The expected output here is-