Skip to content

Commit

Permalink
fix: escape backslash in regex
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
  • Loading branch information
victorgarcia98 committed May 29, 2023
1 parent 70cbb3e commit e3807ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flexmeasures/data/models/planning/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def get_pattern_match_word(word: str) -> str:
:return: regex expression
"""

regex = r"(^|\s|$|\b|\+|\-|\*|/\|\\)"
regex = r"(^|\s|$|\b|\+|\-|\*|\/\|\\)"

return regex + re.escape(word) + regex

Expand Down

0 comments on commit e3807ed

Please sign in to comment.