[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: expr '0' pattern capture issue.
From: |
Andreas Schwab |
Subject: |
Re: expr '0' pattern capture issue. |
Date: |
Mon, 08 Dec 2003 15:01:23 +0100 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux) |
benjamin gerard <address@hidden> writes:
> $expr 'a0b' : 'a\(.\)b' \| '1
>
> The previous sample returns '1'. I assume this is because the matching
> pattern is '0' and it is evaluate as false.
>
> I am just wandering if this is expected behaviour ?
You have just answered you question above.
expr1 | expr2 Returns the evaluation of expr1 if it is neither null nor
zero; otherwise, returns the evaluation of expr2 if it is
not null; otherwise, zero.
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."