November 2017
Beginner to intermediate
204 pages
5h 23m
English
Regex objects in Python also have a split() method. The split method splits the search string into an array of substrings. The splits occur at each location along the string where the pattern is identified. The result is an array of strings that occur between instances of the pattern. If the pattern occurs at the beginning or end of the search string, an empty string is included at the beginning or end of the resulting array, respectively:
....print(a_or_b.split("123a456b789"))print(a_or_b.split("a1b"))
Read now
Unlock full access