November 2017
Beginner to intermediate
204 pages
5h 23m
English
Similarly, if the $ symbol is used at the end of the pattern string, the regular expression will only produce a match if the pattern appears at the end of the search string:
....a_at_end = re.compile("a$")if a_at_end.search("a"): print("'a' is a match")if a_at_end.search("a 1234"): print("'a 1234' is a match")if a_at_end.search("1234 a"): print("'1234 a' is a match")
Read now
Unlock full access