in reply to Possessive Quantifiers in Perl 5.10 regexps
Your regex doesn't backtrack if there is a closing quote, so in this case the possessive quantifier doesn't help here.
I guess that the regex engine optimizes the search by looking for a literal ", and fails immediately if it can't find one. That works the same way in both cases.
Update: to disable this optimization you can use ["'] instead of " (a single char character class doesn't disable it).
|
|---|