Commit 1c8e39fa authored by Chris McDonough's avatar Chris McDonough

Fixed regex screwups (replaced \0 with \000).

parent 473cf348
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""HTML formated DocumentTemplates """HTML formated DocumentTemplates
$Id: DT_HTML.py,v 1.25 2001/04/27 18:07:09 andreas Exp $""" $Id: DT_HTML.py,v 1.26 2001/04/28 04:59:13 chrism Exp $"""
from DT_String import String, FileMixin from DT_String import String, FileMixin
import DT_String, re import DT_String, re
...@@ -94,8 +94,8 @@ from string import strip, find, split, join, rfind, replace ...@@ -94,8 +94,8 @@ from string import strip, find, split, join, rfind, replace
class dtml_re_class: class dtml_re_class:
""" This needs to be replaced before 2.4. It's a hackaround. """ """ This needs to be replaced before 2.4. It's a hackaround. """
def search(self, text, start=0, def search(self, text, start=0,
name_match=re.compile(r'[\0- ]*[a-zA-Z]+[\0- ]*').match, name_match=re.compile(r'[\000- ]*[a-zA-Z]+[\000- ]*').match,
end_match=re.compile(r'[\0- ]*(/|end)', re.I).match, end_match=re.compile(r'[\000- ]*(/|end)', re.I).match,
start_search=re.compile(r'[<&]').search, start_search=re.compile(r'[<&]').search,
ent_name=re.compile(r'[-a-zA-Z0-9_.]+').match, ent_name=re.compile(r'[-a-zA-Z0-9_.]+').match,
find=find, find=find,
......
...@@ -154,12 +154,10 @@ class Let: ...@@ -154,12 +154,10 @@ class Let:
def parse_let_params(text, def parse_let_params(text,
result=None, result=None,
tag='let', tag='let',
parmre=re.compile( parmre=re.compile(r'([\000- ]*([^\000- ="]+)=([^\000- ="]+))'),
r'([\0- ]*([^\0- =\"]+)=([^\0- =\"]+))'), qparmre=re.compile(r'([\000- ]*([^\000- ="]+)="([^"]*)")'),
qparmre=re.compile(
r'([\0- ]*([^\0- =\"]+)="([^"]*)\")'),
**parms): **parms):
result=result or [] result=result or []
mo = parmre.match(text) mo = parmre.match(text)
......
...@@ -82,8 +82,8 @@ ...@@ -82,8 +82,8 @@
# attributions are listed in the accompanying credits file. # attributions are listed in the accompanying credits file.
# #
############################################################################## ##############################################################################
'''$Id: DT_Util.py,v 1.74 2001/04/27 20:27:39 shane Exp $''' '''$Id: DT_Util.py,v 1.75 2001/04/28 04:58:53 chrism Exp $'''
__version__='$Revision: 1.74 $'[11:-2] __version__='$Revision: 1.75 $'[11:-2]
import re, os import re, os
from string import lower from string import lower
...@@ -340,13 +340,13 @@ def parse_params(text, ...@@ -340,13 +340,13 @@ def parse_params(text,
result=None, result=None,
tag='', tag='',
unparmre=re.compile( unparmre=re.compile(
r'([\0- ]*([^\0- =\"]+))'), r'([\000- ]*([^\000- ="]+))'),
qunparmre=re.compile( qunparmre=re.compile(
r'([\0- ]*("[^"]*"))'), r'([\000- ]*("[^"]*"))'),
parmre=re.compile( parmre=re.compile(
r'([\0- ]*([^\0- =\"]+)=([^\0- =\"]+))'), r'([\000- ]*([^\000- ="]+)=([^\000- ="]+))'),
qparmre=re.compile( qparmre=re.compile(
r'([\0- ]*([^\0- =\"]+)="([^"]*)\")'), r'([\000- ]*([^\000- ="]+)="([^"]*)")'),
**parms): **parms):
"""Parse tag parameters """Parse tag parameters
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment