MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / split

Function split

tools/python-3.11.9-amd64/Lib/re/__init__.py:198–206  ·  view source on GitHub ↗

Split the source string by the occurrences of the pattern, returning a list containing the resulting substrings. If capturing parentheses are used in pattern, then the text of all groups in the pattern are also returned as part of the resulting list. If maxsplit is nonzero, at

(pattern, string, maxsplit=0, flags=0)

Source from the content-addressed store, hash-verified

196 return _compile(pattern, flags).subn(repl, string, count)
197
198def split(pattern, string, maxsplit=0, flags=0):
199 """Split the source string by the occurrences of the pattern,
200 returning a list containing the resulting substrings. If
201 capturing parentheses are used in pattern, then the text of all
202 groups in the pattern are also returned as part of the resulting
203 list. If maxsplit is nonzero, at most maxsplit splits occur,
204 and the remainder of the string is returned as the final element
205 of the list."""
206 return _compile(pattern, flags).split(string, maxsplit)
207
208def findall(pattern, string, flags=0):
209 """Return a list of all non-overlapping matches in the string.

Callers

nothing calls this directly

Calls 2

_compileFunction · 0.70
splitMethod · 0.45

Tested by

no test coverage detected