How to get sum with decimal places if decimal separator is also delimiter

1 day ago 3
ARTICLE AD BOX

Number pattern

-?[0-9]{1,3}(?:[_,.]?[0-9]{3})*[.,]?[0-9]{0,2}

is used to get amount from invoice text. Decimal separator . can also be number delimiter like

Summa_apmaksai 1640.09._EUR

Tried to get numberic value

1640.09

from this text using regex

Summa_apmaksai [ _:€]*(?<summa>-?[0-9]{1,3}(?:[_,.]?[0-9]{3})*[.,]?[0-9]{0,2})[\.\s_€]

But it returns only value up to first decimal, 1640.

How to get whole value 1640.09 ?

https://regex101.com/r/2iRtWN/1

Using C# and .NET 10

Andrus's user avatar

1

Read Entire Article