Move word split to regex pattern class

This commit is contained in:
Veronica Berglyd Olsen
2024-09-22 17:37:12 +02:00
parent c08033d153
commit 37c469dbc7
4 changed files with 60 additions and 9 deletions
+6
View File
@@ -32,12 +32,18 @@ from novelwriter.constants import nwRegEx
class RegExPatterns:
# Static RegExes
_rxWords = re.compile(nwRegEx.WORDS, re.UNICODE)
_rxItalic = re.compile(nwRegEx.FMT_EI, re.UNICODE)
_rxBold = re.compile(nwRegEx.FMT_EB, re.UNICODE)
_rxStrike = re.compile(nwRegEx.FMT_ST, re.UNICODE)
_rxSCPlain = re.compile(nwRegEx.FMT_SC, re.UNICODE)
_rxSCValue = re.compile(nwRegEx.FMT_SV, re.UNICODE)
@property
def wordSplit(self) -> re.Pattern:
"""Split text into words."""
return self._rxWords
@property
def markdownItalic(self) -> re.Pattern:
"""Markdown italic style."""