Return to Snippet

Revision: 23867
at February 16, 2010 05:02 by adrianparr


Initial Code
var myString:String = "<p><b>bold</b> <i>italic</i> <a href='#'>link</a> <br>linebreak</p>";
trace(myString)
var removeHtmlRegExp:RegExp = new RegExp("<[^<]+?>", "gi");
myString = myString.replace(removeHtmlRegExp, "");
trace(myString);

// OUTPUT
// <p><b>bold</b> <i>italic</i> <a href='#'>link</a> <br>linebreak</p>
// bold italic link linebreak

Initial URL
http://www.gskinner.com/RegExr/

Initial Description
Grant Skinner's RegExr: Online Regular Expression Testing Tool is very handy for checking your regular expressions.
http://www.gskinner.com/RegExr/

Initial Title
AS3 Remove HTML Tags From Text

Initial Tags
regex, html, regexp, text

Initial Language
ActionScript 3