diff --git a/api/advent22_api/core/transformed_string.py b/api/advent22_api/core/transformed_string.py index 3099abb..7e354c2 100644 --- a/api/advent22_api/core/transformed_string.py +++ b/api/advent22_api/core/transformed_string.py @@ -4,11 +4,11 @@ from random import Random from pydantic import BaseModel, field_validator -_RE_WHITESPACE = re.compile( +RE_WHITESPACE = re.compile( pattern=r"\s+", flags=re.UNICODE | re.IGNORECASE, ) -_RE_SPECIAL_CHARS = re.compile( +RE_SPECIAL_CHARS = re.compile( pattern=r"[^a-zA-Z0-9\s]+", flags=re.UNICODE | re.IGNORECASE, ) @@ -67,14 +67,14 @@ class TransformedString(BaseModel): result = result.strip() elif self.whitespace is TransformedString.__Whitespace.SPACE: - result = _RE_WHITESPACE.sub(string=result, repl=" ") + result = RE_WHITESPACE.sub(string=result, repl=" ") elif self.whitespace is TransformedString.__Whitespace.REMOVE: - result = _RE_WHITESPACE.sub(string=result, repl="") + result = RE_WHITESPACE.sub(string=result, repl="") # Sonderzeichen verarbeiten if self.special_chars is TransformedString.__SpecialChars.REMOVE: - result = _RE_SPECIAL_CHARS.sub(string=result, repl="") + result = RE_SPECIAL_CHARS.sub(string=result, repl="") # Groß-/Kleinschreibung verarbeiten if self.case is TransformedString.__Case.UPPER: