fix: improved regex

This commit is contained in:
Matthias Jung
2026-04-05 12:21:44 +02:00
parent ceab6a15bb
commit bce6add76b
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ class Index(SpanToken):
Identifies "[index:term:subterm]" or "[index:term]"
"""
pattern = re.compile(r"[ \t]*\[index:([^:\]\s]+)(?::([^:\]\s]+))?\]")
pattern = re.compile(r"[ \t]*\[index:([^:\]\s](?:[^:\]\s]| )*)(?::([^:\]\s](?:[^:\]\s]| )*))?\]")
def __init__(self, match_object):
self.first = match_object.group(1)