Skip to content

Instantly share code, notes, and snippets.

@SteveBenner

SteveBenner/regexes.md

Last active Aug 29, 2015
Embed
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.