I have an issue parsing the dom elements when text contains something like below. I wanted to remove highligted text from actual using Javascript. Can you please help me on this. I want to depend on regular expressions on the same.
I know how to get the quoted attributes using standard string functions and also using dom parser.
For the nodes like below, using string functions such as replace, slice may work but I need to traverse thru entire string. Which is performance issue.
So I wanted to go with regular expressions to find such attributes in a node.
<p class=MsoListParagraphCxSpFirst style='text-indent:-.25in;mso-list:l0 level1 lfo1'>
In the above example I want to remove class attribute and class name could be anything. These nodes are generated from MS word and are not in my control.
EDIT: Following is the pattern I am using to search unquoted text. But it is not working
var pattern = /<p class=\s*=\s*([^" >]+)/im