You're replying to a comment by Chad.

Chad Permalink
March 03, 2010, 17:40

@zebra24 : It's always helpful to have the regexp version for mass changes. Here's a few tricks to make that a little more palatable:

Very magic. eliminates lots of escaping by assuming the special nature of characters:

s/\v()/"\1"/g

Given that we're taking the whole match, we can skip the grouping, and since we aren't matching on the whole word we can skip the word-delimiters:

s/\v\w+/""/g

Which is something that I might actually stand to use instead of the manual method. Patterns full of backslashes, especially, make my eyes bleed. Cheers!

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "unix": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.