Created
August 29, 2013 11:19
-
-
Save davidbehan/6376835 to your computer and use it in GitHub Desktop.
Some regex I use when searching csv, text, html, php files in Sublime Text
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
# Find non alpha numberic characters, excluding _.,- | |
[^a-zA-Z\d\s_.,-] | |
# Find single tag only | |
html - <html\b[^>]*> | |
div - <div\b[^>]*> | |
span - <span\b[^>]*> | |
font - <font\b[^>]*> | |
xml namespace - <\?xml\b[^>]*> | |
xml namespace - <!--\?xml\b[^>]*> | |
# Find tag and everything inside it | |
style - <style\b[^>]*>(.*?)</style> | |
xml - <xml\b[^>]*>(.*?)</xml> | |
# Find specific attributes | |
class= - class=\b[^>]* | |
class= - class=""\b[^>]* | |
style= - style=\b[^>]* | |
style= - style=""\b[^>]* | |
# Find uppercase characters, use CMD + K + L to make lowercase | |
uppercase - <([A-Z][A-Z0-9]*)\b[^>]*> | |
# Find comments | |
<!-- /\* Font(.*)--> | |
<![endif]--> | |
<!--[if gte mso 9]> | |
<!--[if gte mso 10]> | |
# Find empty lines | |
\n\n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment