Skip to content

Commit

Permalink
Fixed regex screwups (replaced \0 with \000).
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonc committed Apr 28, 2001
1 parent 6e4d537 commit bb1fa79
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
6 changes: 3 additions & 3 deletions DT_HTML.py
Expand Up @@ -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
Expand All @@ -94,8 +94,8 @@
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,
Expand Down
8 changes: 3 additions & 5 deletions DT_Let.py
Expand Up @@ -154,12 +154,10 @@ def render(self, md):
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)
Expand Down
12 changes: 6 additions & 6 deletions DT_Util.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bb1fa79

Please sign in to comment.