I'm trying to work through a RegEx which I can use to replace everyone & lt ; And & gt; Text string, when those strings are part of the HTML tag, then EXCEPT.
For example:
var str = " Standard & lt ; I> 1 has & lt; u & gt; 2 & lt; / u & gt; & lt; / p & gt; "
Looking at the above example, I want a resulting string which looks like this:
var str = " p> Value 1 and & lt; u & gt; 2 & lt; / u & gt; & lt; / p & gt; "
It is not easy to see the official answer to any related question.
Regular expressions for this type of parsing are not created. There may even be problems with tokening or dom parsing. The title of your question explains the problem:
Change all & lt; And & gt; Which are not part of an HTML tag
How can you know your parser if & lt; and
Around the word of a HTML parser and Android; tag, or bus, are two orphaned angle brackets? Perhaps your best bet, but how is the orphaned bracket handy is key. Additionally, you will need a mismatched tag or illegal tag to capture cases like the title of your question.
Comments
Post a Comment