On Thu, Mar 1, 2018 at 1:44 PM, Radoslaw Jurga <[email protected]> wrote:
> This does work:
>
> = expr (account =~ /^Assets:?=Livret A/ or account =~ /^Assets:LinXea/) and
> amount > 0.0

That regexp… I do not think it means what you think it means.

Originally, you had a Perl regexp syntax construct (?=…) meaning a
positive lookahead assertion. If interpreted correctly, it would match
an empty substring on the condition that what follows is either
"Livret A" or "LinXea".

After the change, what you have in the left hand branch of the “or” is
a 0-or-1 iterator on the colon, followed by a literal equal sign,
followed by Livret A.

In any case, I don’t think you needed a lookahed assertion in the
first place. Could try with a group or a non-capturing group:

> = expr account =~ /^Assets:(Livret A|LinXea)/ and amount > 0.0
> = expr account =~ /^Assets:(?:Livret A|LinXea)/ and amount > 0.0

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to