@@ -7,7 +7,8 @@ import Data.Aeson
77import qualified Data.Aeson.Pointer as P
88import qualified Data.HashMap.Strict as H
99import qualified Data.Text as T
10−import Text.RegexPR
10+import Data.Text.Encoding (encodeUtf8)
11+import qualified Text.Regex.PCRE.Heavy as RE
1112
1213import Data.Validator.Failure
1314import Import
@@ -126,9 +127,11 @@ patternAndUnmatched f patPropertiesHm x =
126127 -> schema
127128 -> [schema]
128129 checkKey k acc r subSchema =
129− case matchRegexPR (T.unpack r) (T.unpack k) of
130− Nothing -> acc
131− Just _ -> pure subSchema <> acc
130+ case RE.compileM (encodeUtf8 r) mempty of
131+ Left _ -> acc
132+ Right re -> if k RE.=~ re
133+ then pure subSchema <> acc
134+ else acc
132135
133136 runVals
134137 :: [Failure err]