From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6577 invoked by alias); 9 Jul 2003 15:35:48 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6554 invoked from network); 9 Jul 2003 15:35:44 -0000 Received: from unknown (HELO concert.shout.net) (204.253.184.25) by sources.redhat.com with SMTP; 9 Jul 2003 15:35:44 -0000 Received: from duracef.shout.net (duracef.shout.net [204.253.184.12]) by concert.shout.net (8.12.9/8.12.9) with ESMTP id h69FZhop012109; Wed, 9 Jul 2003 10:35:43 -0500 Received: from duracef.shout.net (localhost [127.0.0.1]) by duracef.shout.net (8.12.9/8.12.9) with ESMTP id h69FZhHK024065; Wed, 9 Jul 2003 10:35:43 -0500 Received: (from mec@localhost) by duracef.shout.net (8.12.9/8.12.9/Submit) id h69FZgZf024064; Wed, 9 Jul 2003 11:35:42 -0400 Date: Wed, 09 Jul 2003 15:35:00 -0000 From: Michael Elizabeth Chastain Message-Id: <200307091535.h69FZgZf024064@duracef.shout.net> To: dberlin@dberlin.org Subject: Re: [testsuite] gdb.c++/templates.exp Cc: gdb-patches@sources.redhat.com, mludvig@suse.cz X-SW-Source: 2003-07/txt/msg00178.txt.bz2 Hi Daniel, mec> \\(unsigned ?(long|)\\); mec> mec> It would accept 'unsignedlong' which would be wrong. berlin> It shouldn't, unless the regex isn't whitespace sensitive I think you have it backwards: PATTERN TEXT 'unsigned' -> 'unsigned' ' ?' -> '' '(long|)' -> 'long' Matches 'unsignedlong'. Try it with egrep: $ egrep 'unsigned ?(long|)' unsignedlong unsignedlong Try it with tclsh: $ tclsh % regexp "unsigned ?(long|)" unsignedlong 1 mec> Can you try: mec> mec> \\(unsigned( long|)\\); berlin> Now *this* would accept unsignedlong, unless the regexps in expect are berlin> unlike any other system i've seen. berlin> berlin> This is because the alternation would be between " long" and "", *not* berlin> "long" and "" (IE your regex would not be equivalent to berlin> long| This accepts either '(unsigned);' or '(unsigned long);'. It does not accept '(unsignedlong);'. Try it with egrep or tclsh. I did. $ tclsh % regexp "\\(unsigned( long|)\\)" "(unsigned)" 1 % regexp "\\(unsigned( long|)\\)" "(unsigned long)" 1 % regexp "\\(unsigned( long|)\\)" "(unsignedlong)" 0 I agree that the alternation is between " long" and "". These two regular expressions are equivalent: \\(unsigned( long|)\\); \\((unsigned long|unsigned)\\); Michael C