[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: regexp bug in sed/grep?
From: |
Stepan Kasal |
Subject: |
Re: regexp bug in sed/grep? |
Date: |
Mon, 30 Sep 2002 10:45:49 +0200 |
User-agent: |
Mutt/1.2.5.1i |
Hello,
On Mon, Sep 30, 2002 at 11:26:08AM +0900, Miles Bader wrote:
> $ echo pqrABx | sed -e 's/AB*x?$//'
> $ echo pqrABx | grep 'AB*x?$'
in addition to the explanation by Bob Proulx, I'd like to say that with
gnu versions of sed and grep, you can escape the ? with backslash to get
the metacharacter. So 'AB*x\?$' should work in these cases.
As the grep manual puts it:
| `grep' understands two different versions of regular expression syntax:
| "basic" and "extended". In GNU `grep', there is no difference in
| available functionality using either syntax. In other implementations,
| basic regular expressions are less powerful. The following description
HTH,
Stepan Kasal