Skip to content

Instantly share code, notes, and snippets.

@kennyj
Created November 7, 2011 22:03
Show Gist options
  • Save kennyj/1346347 to your computer and use it in GitHub Desktop.
Save kennyj/1346347 to your computer and use it in GitHub Desktop.
ruby-1.9.2-p180 :019 > a = "x = 'a.\\'b.c' and y = 'b.d.e'"
=> "x = 'a.\\'b.c' and y = 'b.d.e'"
ruby-1.9.2-p180 :020 > a.gsub(/'([^'\\]|\\\\|\\')*?'/, "")
=> "x = and y = "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment