[Python-checkins] CVS: python/dist/src/Lib sgmllib.py,1.27,1.28

Fred L. Drake fdrake@usw-pr-cvs1.sourceforge.net
Wed, 14 Mar 2001 08:18:58 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv29303

Modified Files:
	sgmllib.py 
Log Message:

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


Index: sgmllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sgmllib.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** sgmllib.py	2001/02/19 18:39:09	1.27
--- sgmllib.py	2001/03/14 16:18:56	1.28
***************
*** 34,43 ****
  special = re.compile('<![^<>]*>')
  commentopen = re.compile('<!--')
! commentclose = re.compile('--[%s]*>' % string.whitespace)
  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./:;+*%?!&$\(\)_#=~]*))?')
  
  
--- 34,42 ----
  special = re.compile('<![^<>]*>')
  commentopen = re.compile('<!--')
! commentclose = re.compile(r'--\s*>')
  tagfind = re.compile('[a-zA-Z][-.a-zA-Z0-9]*')
  attrfind = re.compile(
!     r'\s*([a-zA-Z_][-.a-zA-Z_0-9]*)(\s*=\s*'
!     r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$\(\)_#=~]*))?')