As an aside, why do I think of regexps as a kind of "baby" programming language? Because:
- They can be converted to NFAs or DFAs. These NFAs and DFAs resemble assembly languages. The "assembly language" for NFA is actually quite exotic. Reminds me of compilation.
- NFAs can be understood as a kind of Virtual Machine. DFAs are like a subset of a physical machine.
- Just In Time compilation was first applied to regexps before anything else. This was done by Ken Thompson.
- The interpreter->compiler algorithm in RPython (the program that is used to produce PyPy) works quite well on regexps. This essentially automates the work that Ken Thompson did.