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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user