diff options
author | Guido van Rossum <guido@python.org> | 1998-04-03 21:47:12 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-04-03 21:47:12 (GMT) |
commit | 8430c583da5eb966d1aecf882b6f7e6e31fcc26d (patch) | |
tree | 410c14d6b9615d533ea7b8fd8d20557eba26b8e4 /Lib/re.py | |
parent | 07bcd99873c6a481180ce2e6ccc8aff154f5383c (diff) | |
download | cpython-8430c583da5eb966d1aecf882b6f7e6e31fcc26d.zip cpython-8430c583da5eb966d1aecf882b6f7e6e31fcc26d.tar.gz cpython-8430c583da5eb966d1aecf882b6f7e6e31fcc26d.tar.bz2 |
AMK's latest
Diffstat (limited to 'Lib/re.py')
-rw-r--r-- | Lib/re.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -66,8 +66,8 @@ def escape(pattern): alphanum=string.letters+'_'+string.digits for char in pattern: if char not in alphanum: - if char == '\000': result.append(r'\000') - else: result.append('\\' + char) + if char=='\000': result.append('\\000') + else: result.append('\\'+char) else: result.append(char) return string.join(result, '') @@ -132,9 +132,9 @@ class RegexObject: def subn(self, repl, source, count=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 string by the - replacement repl. number is the number of substitutions that - were made.""" + non-overlapping occurrences of the pattern in the source + string by the replacement repl. number is the number of + substitutions that were made.""" if count < 0: raise error, "negative substitution count" @@ -174,7 +174,7 @@ class RegexObject: return (string.join(results, ''), n) def split(self, source, maxsplit=0): - """Split \var{string} by the occurrences of the pattern, + """Split the \var{source} string by the occurrences of the pattern, returning a list containing the resulting substrings.""" if maxsplit < 0: |