(set -x ; printf '123\n234\n345\n456\n567\n' | xgrep '(.4.)!') + xgrep '(.4.)!' + printf '123\n234\n345\n456\n567\n' 123 234 345 456 567
Why does this print 345? IMO pattern (.4.) should match 345 and negating it should print all lines except 345. Olga On Tue, Feb 23, 2010 at 11:38 PM, Glenn Fowler <[email protected]> wrote: > > On Tue, 23 Feb 2010 23:32:33 +0100 =?KOI8-R?B?z8zYx8Egy9LZ1sHOz9fTy8HR?= > wrote: >> Is there anywhere a document which describes the differences between >> egrep and xgrep including some examples? > > no document > conjunction is the & binary operator > negation is the ! unary postfix operator > > you can see some test patterns with expected results by > > grep '^A.*[&!]' src/cmd/re/*.dat > > the syntax of the .dat files is documented by > > testregex --man > > src/cmd/re/testregex.c is a standalone regex test harness > > -- , _ _ , { \/`o;====- Olga Kryzhanovska -====;o`\/ } .----'-/`-/ [email protected] \-`\-'----. `'-..-| / Solaris/BSD//C/C++ programmer \ |-..-'` /\/\ /\/\ `--` `--` _______________________________________________ ast-users mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-users
