Just trying to wrap my mind around this question, which occurred to me while I was messing around with positive lookaheads.
Does this regex make any sense?
There is no reason to use the +
quantifier here. Regular expression lookaheads and lookbehinds don't actually match any text, which means that if they match once in a position they will "match" an infinite number of times in a row. It seems python is smart enough not to try matching the lookahead more than once, as it does not get caught up in an infinite loop.
In other words, just stick with unqualified lookaheads: foo(?=bar)
is best.