I think this would be pretty interesting. Take the library RAGEL:
which basically takes a regular _expression_ and outputs the finite-state automaton that recognizes it.
This FSA can then be converted to a C program, or C# or etc RAGEL has several backends.
It would be awesome and actually quite natural if one were to use lightning as a backend. Then the regular _expression_ gets converted directly into machine code, at runtime! If well done the efficiency should be unbeatable. It seems that .net has something like this, but I'm not sure how well-done it is. (e.g. not clear whether it compiles to machine code or virtual machine code, would need to read more about it).
I may implement this someday, someone definitely should :-)
Bruno