I'm having a hard time with this regex. I'm trying to match the amount in the line starting with "Zahlbetrag" which ends with "CHF".
The text to search is:
Zwischentotal 0,00 13,24 906,79 CHF
Zahlbetrag 0,00 13,25 906,80 CHF
My regex so far:
(?<=Zahlbetrag)(?:.*?)((\d+,\d{2})(?=([\s]*)CHF))
The result of this is currently (tested with https://regex101.com/):
Match 1: 0,00 13,25 906,80
Group 1: 906,80
Group 2: 906,80
Group 3:
But I need the first match to be:
Match 1: 906,80
It should only include the last number, not the full line. Does anyone know how this can be accomplished?