JavaScript interview with a Google engineer: Regular expression evaluator