| 992 | #if RAPIDJSON_SCHEMA_USE_INTERNALREGEX |
| 993 | template <typename ValueType> |
| 994 | RegexType* CreatePattern(const ValueType& value) { |
| 995 | if (value.IsString()) { |
| 996 | RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString()); |
| 997 | if (!r->IsValid()) { |
| 998 | r->~RegexType(); |
| 999 | AllocatorType::Free(r); |
| 1000 | r = 0; |
| 1001 | } |
| 1002 | return r; |
| 1003 | } |
| 1004 | return 0; |
| 1005 | } |
| 1006 | |
| 1007 | static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType) { |
| 1008 | GenericRegexSearch<RegexType> rs(*pattern); |