Hi, On 07.06.2012 20:26, Paul_Koning@Dell.com wrote: > Yes, but since you're dealing with a regular (not raw) string here, the \ needs to be doubled, otherwise it is treated as a string character escape instead of a backslash character inside the string. So one of these will match space followed by asterisk: your post let me wonder, why my code worked for me and I asked the python interpreter for his opinion: >>> '^QFile ( \*)?$' '^QFile ( \\*)?$' >>> '^QFile ( \\*)?$' '^QFile ( \\*)?$' >>> r'^QFile ( \*)?$' '^QFile ( \\*)?$' Equal output for all versions of these strings and for python versions 2.4, 2.6, 2.7 and 3.2 (the versions I found on severals machines). - Joachim