What is the difference between re.search and re.match?
re.match is anchored at the beginning of the string. That has nothing to do with newlines, so it is not the same as using ^ in the pattern. As the re.match documentation says: If zero or more characters at the beginning of string match the regular expression pattern, return a corresponding MatchObject instance. Return None … Read more