Fix an off-by-one error.  Also make the code a little more explicit in what it
is trying to do.
Bill Fisher:  Fix for failing to throw an exception in regex when parsing an invalid escape sequence.  This fixes http://llvm.org/bugs/show_bug.cgi?id=16023