Thanks for the report.
Did you build that yourself? On what sort of system?
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.
$ expr 'whats/wrong/here' : '\([a-z/]*/\).*'
whats/wrong/
Would you please try the latest version?
Jan Nieuwenhuizen <[EMAIL PROTECTED]> 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.
_______________________________________________
Bug-sh-utils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-sh-utils