Quote:
Originally Posted by Jellby
Instead of . (anything) use [^<>] (anything except < or >), that will miss spans with something inside, but at least it will not catch something wrong, unless the code is wrong to start with.
|
I use that a good bit myself. It means I have to go back through and maybe manually check the remaining (but decidedly fewer) instances that had tags inside and were skipped the first time through, but you're right... it shouldn't do any damage to already valid code.
It's just that every now and again, it would be nice to be able to 'nuke' a particularly pointless class of span without having to think of all the nested 'gotchas' that may bite you (or cause you to have to design a multi-pass strategy). Just every once in a while, mind you. The rest of the time, I enjoy the mental challenge.