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

This reference explains it quite well:

lookaround actually matches characters, but then gives up the match, returning only the result: match or no match. That is why they are called “assertions”. They do not consume characters in the string, but only assert whether a match is possible or not.

... most regex flavors do not allow you to use just any regex inside a lookbehind, because they cannot apply a regular expression backwards. The regular expression engine needs to be able to figure out how many characters to step back before checking the lookbehind.

Hope that helps.

  • Comment on Re^5: How to enforce match priority irrespective of string position