I am maintaining an old system that have saving issue when a string contains a single quote.
For example these will fail:
"update table set column2 = 'O'Connell', column3 = 'O'Riordon' where column1 = 1"
"insert into table (column1, column2, column3, column4, column5, column6, column7) values('O'Reilley','state, postcode','',1,2,'O'Riordon')".
So far I’ve came up with this working vbscript regular expression
([,=(]\s*'[^']*)'([^']*'\s*[,)\s])
Is it possible to write a vbscript regular expression without using the header [(|=|\s|,] and trailer [,|)|\s]?
Thanks.
EDIT: Fix the posted regex to remove | from header and trailer.
The regexp is used as follows
regexp.replace("string","$1''$2")
The only way I can think of works only if the string that contains the single quote never contains whitespace. In that case, you can search for
Explanation: