From 7cb97881ad106c2abbe88e4ed060358ee73ee17e Mon Sep 17 00:00:00 2001 From: Matthias Klumpp Date: Fri, 18 Aug 2023 18:09:58 +0200 Subject: [PATCH] klustakwikio: Adjust regular expression to catch more filenames This will also match filenames with preceding dots & digits now, like "ec013.395.clu.1". --- neo/io/klustakwikio.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neo/io/klustakwikio.py b/neo/io/klustakwikio.py index ab8dd69ae..a580c4736 100644 --- a/neo/io/klustakwikio.py +++ b/neo/io/klustakwikio.py @@ -13,6 +13,7 @@ * Load features in addition to spiketimes. """ +import re import glob import logging from pathlib import Path @@ -439,7 +440,7 @@ def read_filenames(self, typestring='fet'): for v in all_filenames: # Test whether matches format, ie ends with digits split_fn = v.name - m = glob.re.search((r'^(\w+)\.%s\.(\d+)$' % typestring), split_fn) + m = re.search(rf'^(.*)\.{typestring}\.(\d+)$', split_fn) if m is not None: # get basename from first hit if not specified if self.basename is None: