Regular Expression Help
I am having some trouble rebuilding a database or two via a mysql dump. The problem is that some non-escaped single quotes have made their way into certain fields.
So I am writing a script that will fix this... here is my sed command:
sed "s/\([A-Z|a-z|0-9]\)'\([A-Z|a-z|0-9]\)/\1\\\'\2/" $1 > /tmp/$1
This basically changes anything like "abc's" to "abc\\'s" or "123's" to "123\\'s". Now the problem is that this sed command only alters one occurrence within each line. There are multiple occurrences in each line...
So how do I make this alter multiple occurrences found in each line?
Last edited by WeNdeL; 08-14-2003 at 09:50 AM.
|