Commit c0e7c830 authored by Milo Yip's avatar Milo Yip

Fix a bug and add document in regex

parent 3eb19cea
...@@ -42,7 +42,9 @@ static const SizeType kRegexInvalidRange = ~SizeType(0); ...@@ -42,7 +42,9 @@ static const SizeType kRegexInvalidRange = ~SizeType(0);
- \c a{3} Exactly 3 times - \c a{3} Exactly 3 times
- \c a{3,} At least 3 times - \c a{3,} At least 3 times
- \c a{3,5} 3 to 5 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 . Any character
- \c [abc] Character classes - \c [abc] Character classes
- \c [a-c] Character class range - \c [a-c] Character class range
...@@ -606,8 +608,8 @@ private: ...@@ -606,8 +608,8 @@ private:
else if (!(stateSet[index >> 5] & (1 << (index & 31)))) { else if (!(stateSet[index >> 5] & (1 << (index & 31)))) {
stateSet[index >> 5] |= (1 << (index & 31)); stateSet[index >> 5] |= (1 << (index & 31));
*l.template Push<SizeType>() = index; *l.template Push<SizeType>() = index;
return GetState(index).out == kRegexInvalidState;
} }
return GetState(index).out == kRegexInvalidState;
} }
bool MatchRange(SizeType rangeIndex, unsigned codepoint) const { bool MatchRange(SizeType rangeIndex, unsigned codepoint) const {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment