public:
PatternChunk(StringRef S, bool isRE) : Str(S), isRegEx(isRE) {}
-
size_t Match(StringRef Buffer, size_t &MatchLen) const {
if (!isRegEx) {
// Fixed string match.
// Regex match.
SmallVector<StringRef, 4> MatchInfo;
- if (!Regex(Str, Regex::Sub).match(Buffer, &MatchInfo))
+ if (!Regex(Str, Regex::Sub|Regex::Newline).match(Buffer, &MatchInfo))
return StringRef::npos;
// Successful regex match.
MatchLen = FullMatch.size();
return FullMatch.data()-Buffer.data();
}
-
};
class Pattern {