[testsuite] gdb.c++/templates.exp

Michael Elizabeth Chastain mec@shout.net
Wed Jul 9 15:50:00 GMT 2003


Hi Daniel,

>>   \\(unsigned ?(long|)\\);

> Just to be clear, this regex should accept nothing, "long", "unsigned 
> long", and "unsigned".
> This may be *wrong*, but it certainly shouldn't accept "unsignedlong".
> The ? should be applying to "unsigned ", not just the whitespace.

The ? applies to one atom before it.  An atom is just the single
character ' ', not the whole string 'unsigned '.  So says "Tcl and the
Tk Toolkit", section 9.3.

It's been that way in Unix regular expressions since the days of 'ed'.

What with the fifty different regular expression implementations out
there, maybe one of them does behave that way.  Not TCL or egrep or perl
or vim though.

Michael C



More information about the Gdb-patches mailing list