summaryrefslogtreecommitdiffstats
path: root/Lib/sre.py
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2000-09-21 17:03:25 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2000-09-21 17:03:25 (GMT)
commit5644b7fad1f354f43b3dd4ae890edcade2c0bcbc (patch)
treec4d3f61dbdbc137f555b369ba973644c5b8fd7e8 /Lib/sre.py
parent44627016da509b2bc59c38d7bf0ba592fe56a7a3 (diff)
downloadcpython-5644b7fad1f354f43b3dd4ae890edcade2c0bcbc.zip
cpython-5644b7fad1f354f43b3dd4ae890edcade2c0bcbc.tar.gz
cpython-5644b7fad1f354f43b3dd4ae890edcade2c0bcbc.tar.bz2
- fixed yet another gcc -pedantic warning
- added experimental "expand" method to match objects - don't use the buffer interface on unicode strings
Diffstat (limited to 'Lib/sre.py')
-rw-r--r--Lib/sre.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/sre.py b/Lib/sre.py
index b1ed9fb..6dea5c4 100644
--- a/Lib/sre.py
+++ b/Lib/sre.py
@@ -105,6 +105,11 @@ def _compile(*key):
_cache[key] = p
return p
+def _expand(pattern, match, template):
+ # internal: match.expand implementation hook
+ template = sre_parse.parse_template(template, pattern)
+ return sre_parse.expand_template(template, match)
+
def _sub(pattern, template, string, count=0):
# internal: pattern.sub implementation hook
return _subn(pattern, template, string, count)[0]