Last active
December 14, 2015 13:38
-
-
Save fstorr/5094689 to your computer and use it in GitHub Desktop.
Make brain hurt fewer
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
| ** Look arounds ** | |
| Positive lookahead: q(?=u) // find q followed by u | |
| Negative lookahead: q(?!u) // find q not followed by u | |
| Positive lookbehind: (?<=a)b // find b preceeded by a. CANNOT BE VARIBLE LENGTH | |
| Negative lookbehind: (?<!a)b // find b not preceeded by a. CANNOT BE VARIBLE LENGTH | |
| ** Atomic grouping ** | |
| <!-- replace ' or ’ with HTML apostrophe --> | |
| Find: (?<=\w)'|’(?=\w) | |
| Replace: ’ | |
| <!-- find repeated words --> | |
| Find: \b([\w']+)\s\1 | |
| <!-- replace CSS #xxxxxx with #xxx --> | |
| Find: #([\da-f])\1([\da-f])\2([\da-f])\3\b | |
| Replace: #$1$2$3 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment