verbose regex for cleaner human-reading

This commit is contained in:
2022-06-22 15:50:52 -05:00
parent dc7e5abf4e
commit ff51dd7f8b

View File

@@ -17,7 +17,15 @@ import wordlinator.utils
BASE_URL = "https://api.twitter.com/2"
WORDLE_RE = re.compile(
r"Wordle(\w+)? (?P<number>\d+) (?P<score>[X\d])/6", re.IGNORECASE
r"""
Wordle # Line Leader
(\w+)? # etta factor (catches ...Golf, etc)
\s # single space
(?P<number>\d+) # game number
\s # single space
(?P<score>[X\d])/6 # score out of 6
""",
re.IGNORECASE | re.VERBOSE,
)
TOKEN = os.getenv("TWITTER_TOKEN")