Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
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
You can’t perform that action at this time.