I\'m running into an issue that I think is being caused by needing to double-up on some single quotes inside a string. However, JS\'s string.replace uses RegEx, and I\'ve ne
I don't know the exact syntax, but you can find that out yourself:
str.replace(/(?!')'(?!')/g, "''");
Haven't tested this yet, but if it works, it also takes care of only replacing occurances of one single quote in a row. The g modifier is necessary for replacing all ocurrences.
You don't need to use RegExp.
String patterm version:
str.replace("'", "''", 'g')
RegExp pattern version:
str.replace(/'/g, "''")
Here you have some useful RegExp links: