Last active
December 29, 2015 17:39
-
-
Save jlnwlf/7705401 to your computer and use it in GitHub Desktop.
Useful Regex I could use someday...
This file contains hidden or 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
Matching href without " or ' (with escaping support): | |
(?<=href\=('|"))((?!\1).)+ | |
Matching youtube video URLs without " or ' (with escaping support) | |
(?<=href\=('|"))(((http(s)?:)?//)?(youtube.com))?/watch\?((?!\1).)+ | |
Matching any >1 consecutive empty lines: | |
(?<=\s\n)(\s*\n) | |
Matching per line slash (/) separated values without slashes | |
([^/\r\n]+) | |
Matching <% ... %> code blocks in Mako templates | |
<%(.*?\n?)+?%> and the less memory killer (sublime text): (?s)<%.+?%> (flag s for multiline) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment