From c0e7c8304b61d539302d28ad428d5e4da41ec7c7 Mon Sep 17 00:00:00 2001 From: Milo Yip Date: Fri, 29 May 2015 16:02:14 +0800 Subject: [PATCH] Fix a bug and add document in regex --- include/rapidjson/internal/regex.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/rapidjson/internal/regex.h b/include/rapidjson/internal/regex.h index 5d483bf..056535e 100644 --- a/include/rapidjson/internal/regex.h +++ b/include/rapidjson/internal/regex.h @@ -42,7 +42,9 @@ static const SizeType kRegexInvalidRange = ~SizeType(0); - \c a{3} Exactly 3 times - \c a{3,} At least 3 times - \c a{3,5} 3 to 5 times - - \c (ab)* Grouping + - \c (ab) Grouping + - \c ^a At the beginning + - \c a$ At the end - \c . Any character - \c [abc] Character classes - \c [a-c] Character class range @@ -606,8 +608,8 @@ private: else if (!(stateSet[index >> 5] & (1 << (index & 31)))) { stateSet[index >> 5] |= (1 << (index & 31)); *l.template Push() = index; - return GetState(index).out == kRegexInvalidState; } + return GetState(index).out == kRegexInvalidState; } bool MatchRange(SizeType rangeIndex, unsigned codepoint) const {