Change regexes to use the pattern object directly

This commit is contained in:
Veronica Berglyd Olsen
2024-09-28 11:20:09 +02:00
parent 5c07148eb2
commit 5ed03e29f3
4 changed files with 13 additions and 14 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ from novelwriter.text.patterns import REGEX_PATTERNS
def allMatches(regEx: re.Pattern, text: str) -> list[list[str]]:
"""Get all matches for a regex."""
result = []
for match in re.finditer(regEx, text):
for match in regEx.finditer(text):
result.append([
(match.group(n), match.start(n), match.end(n))
for n in range((match.lastindex or 0) + 1)