Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:09
What would you like to do?
Useful Regular Expressions I’ve come up with

Regular Expressions

Text coloring / highlighting

I use the following regexes with iTerm2's 'trigger' feature to create some basic syntax highlighting.

(?<=- )([A-Z][A-Z ]+:)+ Colorize CONSTANTS Magenta
(?<=- )(:|")\w*"?(?= =>) Colorize :keys => / "keys" => Yellow
^([^=]*)(?==) Colorize ENV_VARS Cyan
(?<=[^=])= Colorize the = separator Dark Grey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment