The YARR interpreter has a function for matching nested expressions that might not consume characters. This is needed when we try to match containing parenthesis which have variable counts, but their contents match an empty string. An example regex is /(a*)*x/. When we use this regex to match "aa", we'll match the "aa" via the parenthesis sub pattern and then fail trying to match the 'x'. Then we'll backtrack. The (a*)* subexpression will match a zero length string and try match the 'x'. We have now entered an infinite loop that only exits due to exceeding the loop try count. In the case where the parenthesis has a variable count, the interpreter will make sure that each time we try matching the parenthesis contents, we make sure we actually consumes characters. This is done in the interpreter with the function matchNonZeroDisjunction(). The JIT should emit the same kind of logic.