http://qs321.pair.com?node_id=11129260


in reply to Re^2: How to enforce match priority irrespective of string position
in thread How to enforce match priority irrespective of string position

I'd say use Hippo's template of an SSCCE Re: Matching a string in a parenthesized block (regex help) to write some tests for This would certainly be beneficial for you too.

Other than that, |-or conditions with swallowing can prioritize areas, like "quoted" ones. demo

DB<132> $_ = 'phrase. "phrase1.phrase2" phrase. phrase' 0 'phrase. "phrase1.phrase2" phrase. phrase' DB<133> split /(".*?"|\.)/ 0 'phrase' 1 '.' 2 ' ' 3 '"phrase1.phrase2"' 4 ' phrase' 5 '.' 6 ' phrase' DB<134>