Raise the flag

Report a typo

Take a look at the following piece of code:

template = "ahoy,.me hearties!"
string = "..."
match = re.match(template, string, flags=...)
print(match is not None)  # The output is True

There are two empty values in this code: string and flags.

Match the possible values of the string variable and the flags that you have to set in the match() function to make the template match the string.

Match the items from left and right columns
AHOY,
ME HEARTIES!
ahoy,
me hearties!
AHOY, me hearties!
re.DOTALL
re.IGNORECASE + re.DOTALL
re.IGNORECASE
___

Create a free account to access the full topic