3 ms·
This can easily be summarized -- if the target HTML meets a modern specification and has no serious syntax errors, or if we're really talking about XHTML, which
by lutusp 14y ago
This can easily be summarized -- if the target HTML meets a modern specification and has no serious syntax errors, or if we're really talking about XHTML, which has a much stricter syntax, then no problem. Otherwise parsing the target will produce endless difficulties.
But then, if the HTML has syntax problems or contains inconsistent syntax, then no approach is entirely reliable, which means it's not about regular expressions any more.