in reply to Backwards searching with regexps
I wonder... May I state the problem as: Find any match of this pattern (say patA) that is followed by this other pattern (say patB)? Then, I suggest: Could you find first for patA - in your question it would be the pattern to be matched backwards - and then find next for patB - which you did match first - and:
1. Possibly avoid issues like "match backwards right-to-left or left-to-right? - i.e. would I tell it to match 'tac' backwards to find previous 'cat'".
2. Allow you to save this offset from the start of the scalar.