/^
"[^"\\]* # double quoted strings with possibly escaped double quotes
(?:
\\. # escaped character (quote)
[^"\\]* # unrolled loop following Jeffrey E.F. Friedl
)*
"
/x
i implemented an unrolled loop in combination with takeWhile. (the last use of the deprecated zeroOrMore was also removed)
this leads to a big performance boost from ca ~250%(without xdebug) - ~330%(with xdebug) - both without opcache.
related: #17 inspired by this regex:
i implemented an unrolled loop in combination with takeWhile. (the last use of the deprecated zeroOrMore was also removed) this leads to a big performance boost from ca ~250%(without xdebug) - ~330%(with xdebug) - both without opcache.
before: bench_json_encode: 4.133μs bench_Parsica_JSON: 4.109ms bench_basemax_jpophp: 432.128μs
after: bench_json_encode: 3.744μs bench_Parsica_JSON: 1.662ms bench_basemax_jpophp: 401.154μs