Last active
September 23, 2018 07:31
-
-
Save twome/59a054ea26c9001cea51 to your computer and use it in GitHub Desktop.
Regexes for finding and cleaning up ancient/bad/deprecated HTML for manual archaeology
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Exclude from find-all | |
-tmp/*, -.sass-cache/*, -*.min.*, -*-min.* | |
# Deprecated attributes | |
\s*(width|height|border|cellpadding|cellspacing|bordercolor|bgcolor|color|valign|align|hspace|vspace)="[^"]*" | |
# If there's no quotes, you can also hit their values | |
\s*(width|height|hspace|vspace)=\d*\%? | |
\s*(bordercolor|bgcolor|color)=#?\d{3,6} | |
# Deprecated tags | |
</?(font|center)[^>]*> | |
# Class names | |
(?:class=")[\w\- ]+(?:") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment