Skip to content

Instantly share code, notes, and snippets.

@phylake
Last active December 16, 2015 04:49
Show Gist options
  • Save phylake/5379813 to your computer and use it in GitHub Desktop.
Save phylake/5379813 to your computer and use it in GitHub Desktop.
reg ex goodies

Replace all logical or assignment A ||= B with A || (A = B)

([^\s]+) \|\|= (.*);
$1 || ($1 = $2);

Turn underscore delimited identifiers into camel case

(\w+)_(\w)(\w+)
$1\U$2\E$3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment