Skip to content

Instantly share code, notes, and snippets.

@BrianMehrman
Created June 12, 2017 15:34
Show Gist options
  • Save BrianMehrman/cb8f1195844835814b147b9973d30d67 to your computer and use it in GitHub Desktop.
Save BrianMehrman/cb8f1195844835814b147b9973d30d67 to your computer and use it in GitHub Desktop.
Every forget to wrap some text in some parenthesis or brackets. Yeah me too.
%s/\(Foo::SubFoo::.*\.name\)/"#{\1}"/g
[
Foo::SubFoo::One,
Foo::SubFoo::Two,
Foo::SubFoo::Three,
Foo::SubFoo::Four
]
# =>
[
"#{Foo::SubFoo::One,}"
"#{Foo::SubFoo::Two,}"
"#{Foo::SubFoo::Three,}"
"#{Foo::SubFoo::Four}"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment