hledger icon indicating copy to clipboard operation
hledger copied to clipboard

csv rules: support easy negation of conditions

Open simonmichael opened this issue 2 years ago • 1 comments

https://hledger.org/dev/hledger.html#matchers : "There's not yet an easy syntax to negate a matcher." We should have this, for if blocks (and possibly if tables ?)

simonmichael avatar Jun 28 '23 05:06 simonmichael

Since 1.32 you can negate a matcher by prepending !, but it's unfinished:

Combining matchers

When an if block has multiple matchers, they are combined as follows:

  • By default they are OR'd (any one of them can match)
  • When a matcher is preceded by ampersand (&) it will be AND'ed with the previous matcher (both of them must match)
  • Added in 1.32 When a matcher is preceded by an exclamation mark (!), the matcher is negated (it may not match).

Currently there is a limitation: you can't use both & and ! on the same line (you can't AND a negated matcher).

simonmichael avatar Feb 15 '24 21:02 simonmichael