cancel
Showing results for 
Search instead for 
Did you mean: 

Can plain text be extractted from Formatted Text Edit?

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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.

Former Member
0 Kudos

Thank you, Very good answer!