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


On 01.06.2012 11:07, somersetgraham wrote:
> def build_dictionary ():
>     pretty_printers_dict[re.compile ('^QFile$')] = lambda
> val:QFilePrinter(val)
>     pretty_printers_dict[re.compile ('^QFile *$')] = lambda
> val:QFilePrinter(val)
you may try something like the following to match both cases:

pretty_printers_dict[re.compile('^QFile ( \*)?$')] = lambda
val:QFilePrinter(val)


The asterisk is a special character in regular expressions and has to be escaped to match an asterisk. Your regexp matches QFile with any count of spaces as postfix.

- 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]