[Zpt] CVS: Packages/TAL - nsgmllib.py:1.3

fred@digiciool.com fred@digiciool.com
Wed, 14 Mar 2001 11:11:14 -0500 (EST)


Update of /cvs-repository/Packages/TAL
In directory korak:/tmp/cvs-serv5842

Modified Files:
	nsgmllib.py 
Log Message:

Change "[%s]" % string.whitespace to r"\s" in regular expressions.



--- Updated File nsgmllib.py in package Packages/TAL --
--- nsgmllib.py	2001/03/14 15:08:31	1.2
+++ nsgmllib.py	2001/03/14 16:11:14	1.3
@@ -33,12 +33,11 @@
 endbracket = re.compile('[<>]')
 special = re.compile('<![^<>]*>')
 commentopen = re.compile('<!--')
-commentclose = re.compile('--[%s]*>' % string.whitespace)
+commentclose = re.compile(r'--\s*>')
 tagfind = re.compile('[a-zA-Z][-.a-zA-Z0-9]*')
 attrfind = re.compile(
-    '[%s]*([a-zA-Z_][-.:a-zA-Z_0-9]*)' % string.whitespace
-    + ('([%s]*=[%s]*' % (string.whitespace, string.whitespace))
-    + r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$\(\)_#=~]*))?')
+    r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s=\s*'
+    r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$\(\)_#=~]*))?')
 
 
 # SGML parser base class -- find tags and call handler functions.