I appreciate reading the conversation you guys had, sorry I wasn't to able to take part. I'm now using a slightly modified version of Eily's regex (proven using the above framework and in my own tests):
our $RXdqs = qr/ " (?> \\. | [^"\\] )* " /x;
Note that all of my $RX... regex variables are used inside other regexes and surrounded on both sides by \s* and various specific characters like parentheses and commas (this is a parser for a formally defined syntax that proceeds through the input text serially, I'm not trying to find $needle inside some giant $haystack). I do have individual tests for these variables now, previously I was only testing the parser at a higher level.
- Andrew