November 2017
Beginner to intermediate
204 pages
5h 23m
English
If the ^ character is used at the beginning of the pattern string, the regular expression will only produce a match if the pattern is found at the beginning of the search string:
....a_at_start = re.compile("^a")if a_at_start.search("a"): print("'a' is a match")if a_at_start.search("a 1234"): print("'a 1234' is a match")if a_at_start.search("1234 a"): print("'1234 a' is a match")
Read now
Unlock full access