November 2017
Beginner to intermediate
204 pages
5h 23m
English
More sophisticated patterns can be produced by combining pattern strings one after the other. In the following example, I've created a regular expression that searches for a number strictly followed by a word. The pattern string that generates the regular expression is composed of the following:
....number_then_word = re.compile("[0-9]+\s[a-z]+(\s|$)")if number_then_word.search("1234 asdf"): print("'1234 asdf' is a match")if number_then_word.search("asdf ...Read now
Unlock full access