Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-ID: <3A098BCE.402AA445@veritas.com>
Date: Wed, 08 Nov 2000 09:22:22 -0800
From: Bob McGowan <rmcgowan@veritas.com>
Organization: VERITAS Software
X-Mailer: Mozilla 4.73 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Helmut Dipper <helmut.dipper@sicad.de>
CC: cygwin@sourceware.cygnus.com
Subject: Re: problem with '^' as first char in BRE for expr
References: <3A09691E.795401B8@sicad.de>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

From the expr man page:

 :      Perform  pattern  matching.   Its   arguments   are
        coerced to strings and the second one is considered
        to be a regular expression, with a  `^'  implicitly  <
        added at the beginning.  The first argument is then  <
        matched against this regular  expression.   If  the
        match  succeeds  and part of the string is enclosed
        in `\(' and `\)', that part is the value of  the  :
        expression; otherwise an integer whose value is the
        number of characters matched is returned.   If  the
        match fails, the : operator returns the null string
        if `\(' and `\)' are used, otherwise 0.   Only  one
        `\(' and `\)' pair can be used.

Helmut Dipper wrote:
> 
> I use bash and fileutils from the latest distribution
> on Windows-NT 4.0 SP5.
> 
> expr 'abc' : '^a\(.\)c$'
> delivers:
> expr: warning: unportable BRE: `^a\(.\)c$': using `^' as the first
> character
> of the basic regular expression is not portable; it is being ignored
> 
> Question:
> I think the character '^' in a BRE is not irrelevant,
> why is it ignored?
> 
> Regards
> Helmut Dipper
> 
> --
> Helmut Dipper                   | SICAD Utilities GmbH
> phone: +49 89 636 41558 | Otto-Hahn-Ring 6
> ___fax: +49 89 636 49613 | D-81730 Muenchen
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan@veritas.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

