I\'m trying to remove unused spans (i.e. those with no attribute) from HTML files, having already cleaned up all the attributes I didn\'t want with other regular expressions
Don't use regexps for processing (HTML ==) XML. You never know what input you'll get. Consider this, valid HTML:
a b c de
Would you have thought of that?
Use an XML processor instead.
Also see the Related Questions (to the right) for your question.