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
Is it possible to write a vbscript regular expression without using the header [(|=|\s|,] and trailer [,|)|\s]?
EDIT: Fix the posted regex to remove | from header and trailer. The regexp is used as follows
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
\B # Assert that there is no alphanumeric character before... ' # the opening quote ( # Match and capture... [^'\s]* # Any number of non-quote/non-whitespace characters ' # One quote [^'\s]* # Any number of non-quote/non-whitespace characters ) # End of capture group 1 ' # Match the closing quote \B # Assert that there is no alphanumeric character afterwards