Quote:
Originally Posted by Tex2002ans
Just because Regex can't do something it wasn't designed to do, doesn't mean Regex must be updated!
You would be using the wrong tool for the job, and what you want is a parser!
Here is some discussion on why Regex isn't recommended for parsing HTML:
https://stackoverflow.com/questions/...e-html-why-not
There is a reason why they are separate beasts. 
|
Yep, basically. Although there are some things you can do with lookaround, like my example. Given a specific known quantity (what regex is for) it will clobber all those nested spans on repeating runs.
Also fun link:
http://stackoverflow.com/questions/6...lanation-in-la
The second answer does a good job explaining why regex is a bad tool for html parsing (and when it is a good tool!).