D-Programming-Language/phobos — pull request #1484 by blackwhale (2013-08-16 21:32:27+00:00)
Title: std.regex: First step to lookbehind in ctRegex

Removes one of the most questionable design desisions in std.regex - execution of bytecode backwards
(a-la UTF-8). While a cute idea at first it is:

- slow as each word has to be checked/skipped till the head of instruction is found
- duplicates literally each matcher's code (x2 with B-T, Thompson, and would be x3 with C-T)
- the above also applies to binary code bloat, as 'back' version code is generated even if not used
- adds extra assumption on bytecode format (that could be avoided to simplify/speed things up)

Instead just reverse required pieces of bytecode during compilation in a centralized manner.
-900 lines of code speak for themselves but more importantly this sets the stage for lookbehind in ctRegex.

P.S. The bidirectional _ability_ of bytecode is left as is at the moment so I can try real hard to imagine the potential use cases we might have had in mind back then...