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
- what you want and
- what you don't want.
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>
In Section
Seekers of Perl Wisdom