escape patterns want to be raw strings

This commit is contained in:
Stefan Harmuth 2023-12-15 07:34:38 +01:00
parent 1fb4582908
commit f0e499f0a3

View File

@ -163,7 +163,7 @@ class AOCDay:
message = soup.article.text
if "That's the right answer" in message:
answer_cache[str_day][str_part]["correct"] = answer
has_rank = re.findall("You achieved.*rank (\d+)", message)
has_rank = re.findall(r"You achieved.*rank (\d+)", message)
print("That's correct!%s" % f" (Rank {has_rank[0]})" if has_rank else "")
webbrowser.open(
"https://adventofcode.com/%d/day/%d#part2" % (self.year, self.day)