I suspect it's likely you won't be able to do this with a simple regex. It sounds to me like you might want to start looking at parsers, such as the classic Parse::RecDescent, the regex-based Regexp::Grammars, or the relatively new Marpa::R2. Or as a middle ground, have a look at how Text::Sentence, Lingua::Sentence, and Lingua::EN::Sentence work internally.
In reply to Re^3: How to enforce match priority irrespective of string position
by haukex
in thread How to enforce match priority irrespective of string position
by Polyglot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |