Wow, I didn&#x27;t even know there was a different way to implement lookbehinds in such a way that variable-length patterns were even allowed:<p>&gt; <i>Generally, there are two ways to implement lookbehind assertions. Perl, for example, requires lookbehind patterns to have a fixed length. That means that quantifiers such as </i> or + are not allowed. This way, the regular expression engine can step back by that fixed length, and match the lookbehind the exact same way as it would match a lookahead, from the stepped back position.*<p>&gt; <i>The regular expression engine in the .NET framework takes a different approach. Instead of needing to know how many characters the lookbehind pattern will match, it simply matches the lookbehind pattern backwards, while reading characters against the normal read direction. This means that the lookbehind pattern can take advantage of the full regular expression syntax and match patterns of arbitrary length.</i><p>&gt; <i>Clearly, the second option is more powerful than the first. That is why the V8 team, and the TC39 champions for this feature, have agreed that JavaScript should adopt the more expressive version, even though its implementation is slightly more complex.</i><p>regular-expressions.info has roughly the same explanation here: <a href="http:&#x2F;&#x2F;www.regular-expressions.info&#x2F;lookaround.html" rel="nofollow">http:&#x2F;&#x2F;www.regular-expressions.info&#x2F;lookaround.html</a><p>I guess I had just assumed that if even Perl didn&#x27;t implement variable-length lookbehinds, then the performance or implementation cost must have been severe enough to justify leaving out such useful flexibility. What is the tradeoff that .NET and now JavaScript are willing to make?<p>edit: According to a comment in the posted article, Perl 6 now implements variable-length lookbehinds <a href="http:&#x2F;&#x2F;www.perl6.org&#x2F;archive&#x2F;rfc&#x2F;72.html" rel="nofollow">http:&#x2F;&#x2F;www.perl6.org&#x2F;archive&#x2F;rfc&#x2F;72.html</a>