def split(self, string, maxsplit=<NUM_LIT:0>):
splitlist = []<EOL>state = _State(string, <NUM_LIT:0>, sys.maxsize, self.flags)<EOL>n = <NUM_LIT:0><EOL>last = state.start<EOL>while not maxsplit or n < maxsplit:<EOL><INDENT>state.reset()<EOL>state.string_position = state.start<EOL>if not state.search(self._code):<EOL><INDENT>break<EOL><DEDENT>if state.start == state.string_position: <EOL><INDENT>if last == state.end:                <EOL><INDENT>break<EOL><DEDENT>state.start += <NUM_LIT:1><EOL>continue<EOL><DEDENT>splitlist.append(string[last:state.start])<EOL>if self.groups:<EOL><INDENT>match = SRE_Match(self, state)<EOL>splitlist += (list(match.groups(None)))<EOL><DEDENT>n += <NUM_LIT:1><EOL>last = state.start = state.string_position<EOL><DEDENT>splitlist.append(string[last:state.end])<EOL>return splitlist<EOL>
Split string by the occurrences of pattern.