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