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

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

Re: Egrep does not support \A, \Z, \s


From: Andreas Schwab
Subject: Re: Egrep does not support \A, \Z, \s
Date: Sat, 02 Jul 2005 16:19:21 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

David Grayson <address@hidden> writes:

> I have GNU grep version 2.5 for linux.
>  
> It seems like it does not support regular expressions properly because
> it does not recognize slash characters.  In particular, the following
> commands produce no output:
>
> echo "hi" | egrep "\Ah"
> echo "hi | egrep "i\Z"
> echo "h i" | egrep "\s"
>
> Maybe this isn't grep's fault.

POSIX says:

  The ERE grammar does not permit several constructs that previous sections
  specify as having undefined results:

  • ORD_CHAR preceded by ’\’

  [...]

  Implementations are permitted to extend the language to allow
  these. Conforming applications cannot use such constructs.

Thus your regepxs are malformed.

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, 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."




reply via email to

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