Skip to content

Instantly share code, notes, and snippets.

@ryan-scott-dev
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save ryan-scott-dev/2490ac13e7afa3384548 to your computer and use it in GitHub Desktop.

Select an option

Save ryan-scott-dev/2490ac13e7afa3384548 to your computer and use it in GitHub Desktop.
Ruby related Regex's
# Find all strings using " unnecessarily
"([^#"'\n;]+)"
# Replace with '
'\1'
# Find all hashes using '=>' syntax
:([^'"=>;\n]+) =>
# Replace with symbol syntax
\1:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment