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

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

parent 473cf348
......@@ -84,7 +84,7 @@
##############################################################################
"""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
import DT_String, re
......@@ -94,8 +94,8 @@ from string import strip, find, split, join, rfind, replace
class dtml_re_class:
""" This needs to be replaced before 2.4. It's a hackaround. """
def search(self, text, start=0,
name_match=re.compile(r'[\0- ]*[a-zA-Z]+[\0- ]*').match,
end_match=re.compile(r'[\0- ]*(/|end)', re.I).match,
name_match=re.compile(r'[\000- ]*[a-zA-Z]+[\000- ]*').match,
end_match=re.compile(r'[\000- ]*(/|end)', re.I).match,
start_search=re.compile(r'[<&]').search,
ent_name=re.compile(r'[-a-zA-Z0-9_.]+').match,
find=find,
......
......@@ -154,12 +154,10 @@ class Let:
def parse_let_params(text,
result=None,
tag='let',
parmre=re.compile(
r'([\0- ]*([^\0- =\"]+)=([^\0- =\"]+))'),
qparmre=re.compile(
r'([\0- ]*([^\0- =\"]+)="([^"]*)\")'),
parmre=re.compile(r'([\000- ]*([^\000- ="]+)=([^\000- ="]+))'),
qparmre=re.compile(r'([\000- ]*([^\000- ="]+)="([^"]*)")'),
**parms):
result=result or []
mo = parmre.match(text)
......
......@@ -82,8 +82,8 @@
# attributions are listed in the accompanying credits file.
#
##############################################################################
'''$Id: DT_Util.py,v 1.74 2001/04/27 20:27:39 shane Exp $'''
__version__='$Revision: 1.74 $'[11:-2]
'''$Id: DT_Util.py,v 1.75 2001/04/28 04:58:53 chrism Exp $'''
__version__='$Revision: 1.75 $'[11:-2]
import re, os
from string import lower
......@@ -340,13 +340,13 @@ def parse_params(text,
result=None,
tag='',
unparmre=re.compile(
r'([\0- ]*([^\0- =\"]+))'),
r'([\000- ]*([^\000- ="]+))'),
qunparmre=re.compile(
r'([\0- ]*("[^"]*"))'),
r'([\000- ]*("[^"]*"))'),
parmre=re.compile(
r'([\0- ]*([^\0- =\"]+)=([^\0- =\"]+))'),
r'([\000- ]*([^\000- ="]+)=([^\000- ="]+))'),
qparmre=re.compile(
r'([\0- ]*([^\0- =\"]+)="([^"]*)\")'),
r'([\000- ]*([^\000- ="]+)="([^"]*)")'),
**parms):
"""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