python regular expression
Andrew Dalke
adalke at mindspring.com
Fri Nov 21 18:21:51 EST 2003
More information about the Python-list mailing list
Fri Nov 21 18:21:51 EST 2003
- Previous message (by thread): python regular expression
- Next message (by thread): python regular expression
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
eddie:
> Can some one help me with a
> regex that can replace everything before the <HTML> tag with nothing?
>>> pat = re.compile(r"^((?!<HTML).)*", re.IGNORECASE | re.DOTALL)
>>> pat.sub("", "junk\n<HTML>stuff")
'<HTML>stuff'
>>> pat.sub("", " <html>stuff")
'<html>stuff'
>>>
Andrew
dalke at dalkescientific.com
- Previous message (by thread): python regular expression
- Next message (by thread): python regular expression
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list