1var arr = ["pippo%12pluto%_prova", "ori%_aa"];
2
3for (i=0; i<arr.length; i++) {
4 console.log( arr[i] + ' => ' + arr[i].replace(/(^|[^'])'(?!')/g, "$1''") );
5}
1var arr = ["abc'def", "abc''de'f"];
2
3for (i=0; i<arr.length; i++) {
4 console.log( arr[i] + ' => ' + arr[i].replace(/(^|[^'])'(?!')/g, "$1''") );
5}