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()