summaryrefslogtreecommitdiff
path: root/Lib/re.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-04-03 21:47:12 +0000
committerGuido van Rossum <guido@python.org>1998-04-03 21:47:12 +0000
commit8430c583da5eb966d1aecf882b6f7e6e31fcc26d (patch)
tree410c14d6b9615d533ea7b8fd8d20557eba26b8e4 /Lib/re.py
parent07bcd99873c6a481180ce2e6ccc8aff154f5383c (diff)
downloadcpython-git-8430c583da5eb966d1aecf882b6f7e6e31fcc26d.tar.gz
AMK's latest
Diffstat (limited to 'Lib/re.py')
-rw-r--r--Lib/re.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/re.py b/Lib/re.py
index 41987739a2..f6bac0871d 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -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: