I have a MySQL table with about 250 blog entries, all using straight quotes (" and ') instead of smart quotes (“ ” and ‘ ’). I need to take those entries and somehow do a batch find-and-replace to replace all straight quotes with smart quotes. Problem is these fields also contain HTML, so I need to ensure all quotes within <>
tags are ignored.
I've exported the appropriate fields and opened up in Sublime Text thinking I could do regex find-and-replace. It's there that I hit a wall, though.
Suggestions?
I don't know how to enter the smart quotes in Sublime Text 2, but I tested the following regex (in Sublime Text 2 itself) for the single quote case using
[]
as the replacement characters:Hopefully this will help.
Here is rubular for it, showing matches.