This is the mail archive of the gdb-patches@sources.redhat.com 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: [testsuite] gdb.c++/templates.exp



On Wednesday, July 9, 2003, at 11:50 AM, Michael Elizabeth Chastain wrote:


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.

Two, actually.


Not TCL or egrep or perl
or vim though.

Of course, I never bothered to use one of these, i was working with a C++ regex engine.

Michael C


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