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.

This commit is contained in:
Jason Orendorff
2013-10-26 23:29:23 -07:00
parent 7859b29725
commit d2d38e2516
4 changed files with 17 additions and 5 deletions

View File

@@ -21,9 +21,10 @@ class RegEx {
int longMatch(std::string stringToMatch);
std::string getPattern();
std::string toString();
static void test();
private:
std::string pattern;
RegExState* begin;
std::vector<RegExState*> currentStates;
};
#endif
#endif