Regex for quoted string with escaping quotes

/"(?:[^"\\]|\\.)*"/

Works in The Regex Coach and PCRE Workbench.

Example of test in JavaScript:

    var s=" function(){ return " Is big \\"problem\\", \\no? "; }";
    var m = s.match(/"(?:[^"\\]|\\.)*"/);
    if (m != null)
        alert(m);

Leave a Comment