I've been reading this post Return only one group with OR condition in Regex to get an understanding how to get only one group in match. Somehow that does not work on my pattern.
Here is the used string:
Ledigingen 4 lediging € 32,48 € 50,92 21,00 %
van 01-01-2019 t/m 31-01-2019
Huur 1 Maand € 8,63 € 8,63 21,00 %
toeslag over € 50,42 (21% BTW) € 2,76 21,00 %
(WHITESPACE) Totaal exclusief BTW € 50,18
BTW hoog (21%) € 50,18 € 50,89
totaal inclusief BTW € 70,07
Currently it extracts each occurence of amount. Is there a way to get only values followed by [Tt]otaa?l excl/incl BTW
?
I guess I've been using positive/negative lookahead wrong.
Desired output from the given input is:
€ 50,18
€ 70,07
RegEx
(?!<=[tT]otaa?l\s*?.*?)([€$]\s*\d+(?:[,.]\d{0,2})?)