Match . Matches the given string against this regular expression. . Returns the number of characters matched. . Returns -1 if no characters were matched (the reason for not returning zero is that we may have an empty regex which is ALWAYS successful at matching zero characters). . REMEMBER that we only match from the start of the buffer!
| 38 | // which is ALWAYS successful at matching zero characters). |
| 39 | // . REMEMBER that we only match from the start of the buffer! |
| 40 | inline int RegEx::Match(const std::string& str) const { |
| 41 | StringCharSource source(str.c_str(), str.size()); |
| 42 | return Match(source); |
| 43 | } |
| 44 | |
| 45 | inline int RegEx::Match(const Stream& in) const { |
| 46 | StreamCharSource source(in); |