bug-sh-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regex matching bug in expr


From: Jan Nieuwenhuizen
Subject: Re: regex matching bug in expr
Date: 03 Jan 2001 12:40:55 +0100
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

Jim Meyering <address@hidden> writes:

> Did you build that yourself?  On what sort of system?

No, it's latest Debian unstable for powerpc.

> Maybe the problem is that it was built to use a buggy version
> of a regexp function.  There are some configure-time tests that try
> to decide whether to use the included lib/regex.c or the version
> in your C library.

> It works fine for me using Debian's expr-2.0i and the expr-2.0.11
> that I built myself on a pretty old redhat system.

Hmm, 2.0.11?  Arg, it seems that powerpc build daemon is lagging
behind again.  How depressing.

apt-show-source says:

shellutils           = 2.0i-1          | shellutils            = 2.0.11-1

There were quite some issues when we went from libc2.1 -> 2.2, quite
possibly the powerpc shellutils binary is still from the 2.1 era.

> Would you please try the latest version?

Yes, I'll try and recompile myself, I'll be back in an hour or so.

> Jan Nieuwenhuizen <address@hidden> wrote:
> | What's the exact definition for expr's regular expressions?  There
> | seems to be a bug, see below.  Its behaviour is not what I expect, and
> | different from grep and sed.
> |
> | Greetings,
> | Jan.
> |
> | from expr info pages:
> |
> | `STRING : REGEX'
> |      Perform pattern matching.  The arguments are coerced to strings
> |      and the second is considered to be a (basic, a la GNU `grep')
> |      regular expression, with a `^' implicitly prepended.  The first
> |      argument is then matched against this regular expression.
> |
> |
> | 12:54:28 appel ~$ expr 'whats/wrong/here' : '\([a-z/]*/\).*'
> |
> | 12:54:32 appel ~$ expr 'whats/wrong/here' : '\([a-z]*/\).*'
> | whats/
> | 12:54:38 appel ~$ echo 'whats/wrong/here' | sed -e s'%^\([a-z/]*/\).*%\1%'
> | whats/wrong/
> | 12:54:48 appel ~$ echo 'whats/wrong/here' | grep '^\([a-z/]*/\).*'
> | whats/wrong/here
> |
> | 12:56:18 appel ~$ expr --version
> | expr (GNU sh-utils) 2.0i
> | Written by Mike Parker.
> 

-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]