November 2017
Beginner to intermediate
204 pages
5h 23m
English
Using \s at any point in the pattern string matches a whitespace character. This is more general then the space character, as it applies to tabs and newline characters:
....a_space_b = re.compile("a\sb")if a_space_b.search("a b"): print("'a b' is a match!")if a_space_b.search("1234 a b 1234"): print("'1234 a b 1234' is a match")if a_space_b.search("ab"): print("'1234 a b 1234' is a match")
Read now
Unlock full access