bug-bash
[Top][All Lists]
Advanced

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

Re: "And" extended matching operator


From: Nikolai Kondrashov
Subject: Re: "And" extended matching operator
Date: Wed, 28 Nov 2012 19:23:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.10) Gecko/20121027 Icedove/10.0.10

On 11/28/2012 04:58 PM, Nikolai Kondrashov wrote:
Would it be possible to add another extended matching operator to already
supported ones? It's just we have "or" in @() and "not (or)" in !(), but no
"and". And combining patterns without it is awkward.

If I want to say "a and not b", I have to write "not (not a or c)", like this:

!(!(a)|c)

If we had "and" operator, say written like &(), it would be possible to write
it as is instead:

&(a|!(c))

which would be more readable.

Is there a chance to have such an operator added?

Or would it be more suitable to add support for '&' separator in the matching
operators instead? So "a and not b" could look like this:

@(a&!(b))

This leaves the possibility of using a mix of '&' and '|' separators in the
operators, but maybe we could state that they have equal precedence, which
would make the implementation simpler.

Sincerely,
Nick



reply via email to

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