Dan M <d...@catfolks.net> writes: > I took at look at http://docs.python.org/howto/regex.html, especially the > section titled "The Backslash Plague". I started out trying :
>>>> import re >>>> r = re.compile('\\\\x([0-9a-fA-F]{2})') >>>> a = "This \xef file \xef has \x20 a bunch \xa0 of \xb0 crap \xc0 The backslash trickery applies to string literals also, not only regexps. Your string does not have the value you think it has. Double each backslash (or make your string raw) and you'll get what you expect. -- Alain. -- http://mail.python.org/mailman/listinfo/python-list