Return a 2-tuple containing (new_string, number). new_string is the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in the source string by the replacement repl. number is the number of substitutions that were made. repl can be either a strin
(pattern, repl, string, count=0, flags=0)
| 185 | return _compile(pattern, flags).sub(repl, string, count) |
| 186 | |
| 187 | def subn(pattern, repl, string, count=0, flags=0): |
| 188 | """Return a 2-tuple containing (new_string, number). |
| 189 | new_string is the string obtained by replacing the leftmost |
| 190 | non-overlapping occurrences of the pattern in the source |
| 191 | string by the replacement repl. number is the number of |
| 192 | substitutions that were made. repl can be either a string or a |
| 193 | callable; if a string, backslash escapes in it are processed. |
| 194 | If it is a callable, it's passed the Match object and must |
| 195 | return a replacement string to be used.""" |
| 196 | return _compile(pattern, flags).subn(repl, string, count) |
| 197 | |
| 198 | def split(pattern, string, maxsplit=0, flags=0): |
| 199 | """Split the source string by the occurrences of the pattern, |
nothing calls this directly
no test coverage detected