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 committed 2013-10-26 23:48:02 -07:00
1 parent 7859b29725
commit d2d38e2516
4 files changed
+17 -5

No files matched your search

+2 -1
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