[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep
From: |
Stephane Chazelas |
Subject: |
Re: grep |
Date: |
Thu, 26 Apr 2007 07:37:49 +0100 |
User-agent: |
Mutt/1.5.6i |
On Wed, Apr 25, 2007 at 11:41:23PM +0200, Bauke Jan Douma wrote:
> Vladislav Gula wrote on 25-04-07 19:33:
> >
> >echo "alias: something" | grep '^[[:alnum:]]:' - not work.
> >
> >
> >why ?
> >
> >Regards,
> >Vladislav
> >
> >
> >P.S.
> >echo "alias: something" | grep '^[[:alnum:]]:.*$' - not work too.
> >( and various variations )
>
> Make it:
> echo "alias: something" | grep '^[[:alnum:]]*:'
> or:
> echo "alias: something" | grep '^[[:alnum:]]\+:'
[...]
It should be noted that \+ is GNU specific, it's a non-standard
hybrid between the basic and extended regexp.
There's not much point using it with grep given that grep has
the standard -E option to use extended regexp:
grep -E '^[[:alnum:]]+:'
The standard BRE equivalent is:
grep '^[[:alnum:]]\{1,\}:'
--
Stéphane
- grep, Vladislav Gula, 2007/04/25
- Re: grep, Dan Hipschman, 2007/04/25
- Re: grep, Bauke Jan Douma, 2007/04/25
- Re: grep, Andreas Schwab, 2007/04/25
- Message not available
- Re: grep,
Stephane Chazelas <=