From 1ec771a6896d01d817adc5bfe81aa5ba65d24885 Mon Sep 17 00:00:00 2001 From: atuonufure Date: Tue, 15 Aug 2023 10:32:00 +0200 Subject: [PATCH] Update matches invocation --- fhirpathpy/engine/invocations/strings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fhirpathpy/engine/invocations/strings.py b/fhirpathpy/engine/invocations/strings.py index 4cf570a..69d959c 100644 --- a/fhirpathpy/engine/invocations/strings.py +++ b/fhirpathpy/engine/invocations/strings.py @@ -133,8 +133,11 @@ def join(ctx, coll, separator=""): # test function def matches(ctx, coll, regex): + if not regex or not coll: + return [] + string = ensure_string_singleton(coll) - valid = re.compile(regex) + valid = re.compile(regex, re.DOTALL) return re.search(valid, string) is not None