| 998 | #if RAPIDJSON_SCHEMA_USE_INTERNALREGEX |
| 999 | template <typename ValueType> |
| 1000 | RegexType* CreatePattern(const ValueType& value) { |
| 1001 | if (value.IsString()) { |
| 1002 | RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString()); |
| 1003 | if (!r->IsValid()) { |
| 1004 | r->~RegexType(); |
| 1005 | AllocatorType::Free(r); |
| 1006 | r = 0; |
| 1007 | } |
| 1008 | return r; |
| 1009 | } |
| 1010 | return 0; |
| 1011 | } |
| 1012 | |
| 1013 | static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType) { |
| 1014 | return pattern->Search(str); |