Regex in python is imported with re
import re
r'Cookie'
search function
, you scan through the given string/sequence, looking for the first location where the regular expression produces a match.group function
returns the string matched by the re. You will see both these functions in more detail later..
- A period. Matches any single character except the newline character.^
- A caret. Matches the start of the string.$
- Matches the end of string.