> IMHO, context matching is a good reason why it is more powerful (and not just > syntactic icing or making the search faster) to support matching two patterns > at > once. I don't think there is a straightforward awk equivalent, or > grep-pipeline > equivalent, to > > % grep -E --context=10 oranges --and '[0-9]'
You can do this both in grep (using -z) and in awk (by changing the record separator) and then matching for \n the desired number of times. The and operator can be done as follows: grep -E '(re1.*re2)|(re2.*re1)' In terms of "power", grep regexp can do a lot. Sure it gets complicated, but the usage is less common, and for the rare cases it can be done. I haven't formally tested this in grep (only in Perl), but I think chaining grep expressions is faster in most cases than using a single complex expression. Making grep do more with less is on my radar, but it is not a priority at the moment. There are some serious bugs that need to be fixed first. Cheers, TAA -- Tony Abou-Assaleh Email: [EMAIL PROTECTED] Web site: http://tony.abou-assaleh.net
