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

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

regexp bug in sed/grep?


From: Miles Bader
Subject: regexp bug in sed/grep?
Date: 30 Sep 2002 11:26:08 +0900

In the following command, I think the `ABx' suffix should be deleted by
the sed program, but it isn't:

   $ echo pqrABx | sed -e 's/AB*x?$//'
   pqrABx

grep fails similarly:

   $ echo pqrABx | grep 'AB*x?$'
   <no output>

If I try the equivalent AWK program, it works as I expect:

   $ echo pqrABx | nawk '{ sub (/AB*x?$/, ""); print }'
   pqr

Is this a bug with the regexp implementation in sed/grep, or am I just
confused?

Thanks,

-Miles

-- 
Somebody has to do something, and it's just incredibly pathetic that it
has to be us.  -- Jerry Garcia
n




reply via email to

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