From: Guido van Rossum Date: Thu, 23 Oct 1997 19:09:21 +0000 (+0000) Subject: Although it's hard to be sure, I *think* this is a working conversion X-Git-Tag: v1.5b1~159 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1fef18118339237de025ed15dc6df4c39315b55d;p=python Although it's hard to be sure, I *think* this is a working conversion from regex to re style regular expressions. This should make sgmllib and htmllib threadsafe, so I can now create a threaded version of webchecker... --- diff --git a/Lib/sgmllib.py b/Lib/sgmllib.py index 8f32001880..8baf519e70 100644 --- a/Lib/sgmllib.py +++ b/Lib/sgmllib.py @@ -8,34 +8,34 @@ # and CDATA (character data -- only end tags are special). -import regex +import re import string # Regular expressions used for parsing -interesting = regex.compile('[&<]') -incomplete = regex.compile('&\([a-zA-Z][a-zA-Z0-9]*\|#[0-9]*\)?\|' - '<\([a-zA-Z][^<>]*\|' - '/\([a-zA-Z][^<>]*\)?\|' - '![^<>]*\)?') - -entityref = regex.compile('&\([a-zA-Z][a-zA-Z0-9]*\)[^a-zA-Z0-9]') -charref = regex.compile('&#\([0-9]+\)[^0-9]') - -starttagopen = regex.compile('<[>a-zA-Z]') -shorttagopen = regex.compile('<[a-zA-Z][a-zA-Z0-9]*/') -shorttag = regex.compile('<\([a-zA-Z][a-zA-Z0-9]*\)/\([^/]*\)/') -endtagopen = regex.compile('a-zA-Z]') -endbracket = regex.compile('[<>]') -special = regex.compile(']*>') -commentopen = regex.compile('