JSFiddle - React, Tailwind, and code Playground
JavaScript
var s = ' my \\"new\\" string and \"this should be matched\"';
var m = s.match(/"(?:[^"\\]|\\.)*"/);
if (m != null)
alert(m);
var s = ' my \\"new\\" string and \"this should be matched\"';
var m = s.match(/"(?:[^"\\]|\\.)*"/);
if (m != null)
alert(m);