This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: help with pretty printing


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


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]