on 09-27-2010 3:41 AM
Hi Experts,
Formatted Text Edit's content is comprised of plain text and tag, for example:
<h3>Hello World!</h3> <p> This is the second line</p><h2>You are welcome!</h2>
I want to remove the tag and extract the plain text, the result should be:
Hello World!
This is the second line.
You are welcome!
How to achive that?
Use regular expression, Function Module, string operation or something else?
Any suggestion and solution are welcome,
Thank you very much.
Best Regards,
Derek
A regular expression is probably the easiest way if you want to remove all formatting. The Formatted Text Edit is based upon XHTML, so a REGEX that finds all tags could be used in a find and replace operation to replace all tags with space. I googled for regular expressions to remove HTML tags and found quite a few hits. That is the beauty of regular expressions, for just about anything someone has already written the expression and posted it. For example
<(.|\n)*>?
find all tags.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.