From e9cdaaffe397fa832823934ccb5f5aeeca8609ad Mon Sep 17 00:00:00 2001 From: arnaudbore Date: Mon, 30 May 2022 14:45:56 -0400 Subject: [PATCH] fix re option --- dcm2bids/sidecar.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dcm2bids/sidecar.py b/dcm2bids/sidecar.py index a973765b..bb99d4b3 100644 --- a/dcm2bids/sidecar.py +++ b/dcm2bids/sidecar.py @@ -175,10 +175,11 @@ def isLink(self, data, criteria): """ def compare(name, pattern): + name = str(name) if self.searchMethod == "re": - return bool(re.search(pattern, name)) + return bool(re.match(pattern, name)) else: - name = str(name) + pattern = str(pattern) if not self.caseSensitive: name = name.lower()