|
If you want to start checking for properly balanced tags you have to build more sophisticated machinery than just regular expressions. Arbitrarily nestable expressions like (1 + (2 * (6 - 3)) and html tag trees, are not regular languages and cannot be accurately described by regular expressions.
It seems like you can get away with only replacing < or > than signs that are not next to text on your first run through. eg. 's/<([^A-Za-z])/<\1/g' and 's/([^A-Za-z])>/\1>/g' .
__________________
Stop intellectual property from infringing on me
|