string encoding regex problem

Roy Smith roy at panix.com
Fri Aug 15 22:14:13 EDT 2014


In article <lsmeej$49n$1 at online.de>,
 Philipp Kraus <philipp.kraus at flashpixx.de> wrote:

> The code works till last week correctly, I don't change the pattern.

OK, so what did you change?  Can you go back to last week's code and 
compare it to what you have now to see what changed?

> My question is, can it be a problem with string encoding? Did I mask 
> the question mark and quotes correctly?

The best thing to do with regular expressions is to use raw strings, 
i.e. r'this is a string'.  The nice thing about that is backslashes are 
not special.  It makes it about 1000% easier to write complicated 
regular expressions.  Simple ones are only 500% easier.



More information about the Python-list mailing list