Suppose I have the following regular expression in Python and I would like to use a variable instead of [1-12]
. For example, my variable is currentMonth = 9
How can I plug currentMonth into the regular expression?
r"(?P<speaker>[A-Za-z\s.]+): (?P<month>[1-12])"