I am trying to create a regular expression that essentially parses out
all the html of a text string. (i.e. - Remove all text between "<"
and ">"). I am not the seasoned regex pro, but my attempts have
failed based on research within the livedocs:

var pattern : RegExp = /\<[a-zA-Z0-9]*>/gi

Does anyone see what is wrong?

var stringToEdit : String = "<!DOCTYPE html PUBLIC '-//W3C//DTD
HTML 4.01 Transitional//EN'><html><head>text I should
see</head></html>";

var pattern : RegExp = /\<[a-zA-Z0-9]*>/gi
var newStr : String = stringToEdit.replace(pattern, "");
trace(newStr);

//Desired Output:
text I should see

//Actual output :-( 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"><html><head>text I should see</head></html>

Reply via email to