Minor refactoring.
Implement regexp evaluation.