PyDocs

Nav

Text Processing Services

subn

re

function (source)
  • subn(pattern, repl, string, count=0, flags=0)
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 string or a
callable; if a string, backslash escapes in it are processed.
If it is a callable, it's passed the Match object and must
return a replacement string to be used.
0 Examples
No examples for re/subn.
See Also
No see-alsos for re/subn
0 Notes
No notes for subn