Re: html escape sequences

2005-03-18 Thread Will McGugan
Leif K-Brooks wrote: Will McGugan wrote: I'd like to replace html escape sequences, like   and ' with single characters. Is there a dictionary defined somewhere I can use to replace these sequences? How about this? import re from htmlentitydefs import name2codepoint _entity_re = re.compile(r'&(?

Re: html escape sequences

2005-03-18 Thread Leif K-Brooks
Will McGugan wrote: I'd like to replace html escape sequences, like   and ' with single characters. Is there a dictionary defined somewhere I can use to replace these sequences? How about this? import re from htmlentitydefs import name2codepoint _entity_re = re.compile(r'&(?:(#)(\d+)|([^;]+));')