Fix a minor bug in the lexer (it would not match the last character of the input) and add Lexer tests.
Fix what looks like an off-by-one error in RegEx::longestMatch()'s lastMatch calculation, and a corresponding +1 in code using longestMatch, and add a test.
Allow RegEx matches of length 0. This seems more correct to me. (However, this is not super important in practice. Grammar files should not contain regular expressions that could match the empty string; if such a RegEx matched 0 characters once, it would match again and again forever, since it wouldn't consume any input.)
Add passing RegEx tests.
Fix substr() bug when the Lexer consumes all the input at once.
Add a passing Lexer test.
Merge pull request #2 from jorendorff/master

Minor bug fixes and tests for RegEx and Lexer, lots of thanks to jorendorff