Skip to content

Commit

Permalink
fix(buses): invalid escape sequence in regex (fixed partial NTHU-SA#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
iwtba4188 committed Dec 12, 2023
1 parent 54de7f0 commit f580827
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/models/buses.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def __init__(self) -> None:
self.detailed_data = {}

def _parse_campus_info(self, variable_string: str):
regex_pattern = r"const " + variable_string + " = (\{.*?\})"
regex_pattern = r"const " + variable_string + r" = (\{.*?\})"
data = re.search(regex_pattern, self._res_text, re.S)
if data is not None:
data = data.group(1)
Expand All @@ -177,7 +177,7 @@ def _parse_campus_info(self, variable_string: str):
return data

def _parse_bus_schedule(self, variable_string: str):
regex_pattern = r"const " + variable_string + " = (\[.*?\])"
regex_pattern = r"const " + variable_string + r" = (\[.*?\])"
data = re.search(regex_pattern, self._res_text, re.S)
if data is not None:
data = data.group(1)
Expand Down

0 comments on commit f580827

Please sign in to comment.