Skip to content

Commit 209c11c

Browse files
committed
Removed + from regex
1 parent ab09005 commit 209c11c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

datajoint/expression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ def proj(self, *attributes, **named_attributes):
314314
Each attribute name can only be used once.
315315
"""
316316
# new attributes in parentheses are included again with the new name without removing original
317-
duplication_pattern = re.compile(fr'^\s*\(\s*(?!{"|".join(CONSTANT_LITERALS)})(?P<name>[a-zA-Z_]+\w*)\s*\)\s*$')
317+
duplication_pattern = re.compile(fr'^\s*\(\s*(?!{"|".join(CONSTANT_LITERALS)})(?P<name>[a-zA-Z_]\w*)\s*\)\s*$')
318318
# attributes without parentheses renamed
319-
rename_pattern = re.compile(fr'^\s*(?!{"|".join(CONSTANT_LITERALS)})(?P<name>[a-zA-Z_]+\w*)\s*$')
319+
rename_pattern = re.compile(fr'^\s*(?!{"|".join(CONSTANT_LITERALS)})(?P<name>[a-zA-Z_]\w*)\s*$')
320320
replicate_map = {k: m.group('name')
321321
for k, m in ((k, duplication_pattern.match(v)) for k, v in named_attributes.items()) if m}
322322
rename_map = {k: m.group('name')

0 commit comments

Comments
 (0)