"max(01)*" <[EMAIL PROTECTED]> wrote:
> i would like to do some uri-decoding, which means to translate patterns
> like "%2b/dhg-%3b %7E" into "+/dhg-; ~"
>>> import urllib
>>> urllib.unquote("%2b/dhg-%3b %7E")
'+/dhg-; ~'
--
http://mail.python.org/mailman/listinfo/python-list
Perhaps a bit more verbose than your Perl regexp, here is a decoder
using pyparsing.
-- Paul
# download pyparsing at http://pyparsing.sourceforge.net
from pyparsing import Word,Combine
# define grammar for matching encoded characters
hexnums = "0123456789ABCDEFabcdef"
encodedChar = Combine( "%"
max(01)* wrote:
> would like to do some uri-decoding, which means to translate patterns
> like "%2b/dhg-%3b %7E" into "+/dhg-; ~": in practice, if a sequence like
> "%2b" is found, it should be translated into one character whose hex
> ascii code is 2b.
>
> i did this:
>
> ...
> import re
> imp
hi everyone.
i would like to do some uri-decoding, which means to translate patterns
like "%2b/dhg-%3b %7E" into "+/dhg-; ~": in practice, if a sequence like
"%2b" is found, it should be translated into one character whose hex
ascii code is 2b.
i did this:
...
import re
import sys
modello =