regular expresions and dolar sign ($) in source string

2009-04-22 Thread Jax
rch(unicode(r"^\(.*(\d+[.]\d+)\)$", "utf8"), a).group(1) 9.99 >>> print re.search(unicode(r"^\(.*\$(\d+[.]\d+)\)$", "utf8"), a).group(1) 399.99 My question is: Why only third regular expression is correct? Please help! It boggles my mind. Jax -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode(lString, "utf8") vs. lString.encode("utf8") vs. ur"jakiś tekst"

2009-04-24 Thread Jax
Sorry, my mistake. My interntion was post this message on pl.comp.lang.python. Jax -- http://mail.python.org/mailman/listinfo/python-list

unicode(lString, "utf8") vs. lString.encode("utf8") vs. ur"jakiś tekst"

2009-04-24 Thread Jax
ng = lString.decode("ISO-8859-15").encode("utf8") Dodatkowo mam pytanie: Czy aby mieć ze stringu podanego w kodzie pythona obiekt unicode zakodowany w utf8 zawsze muszę robić: lString = unicode("jakiś tekst", "utf8") czy może wystarczy lString = ur&qu

decode command line parameters - recomendend way

2009-04-30 Thread Jax
None if len(sys.argv) > 1: lFileConfig = unicode(sys.argv[1], locale.getpreferredencoding()) Or maybe there is other solution? Jax ps: $ python --version Python 2.5.2 -- http://mail.python.org/mailman/listinfo/python-list