I have multiple strings about different products of which some contain only the price of the acutal product but some also extra costs. My problem here is that I only want to extract the price of the actual product out of the string and not any additional costs. The actual price always appears as the first price in the string which is why I tried to solve it with a lazy operator that stops after the first occurence of a specific pattern. However this does not seem to solve my issue.
Example Strings:
2-TB SSD, black, 200.- EUR + Extra Costs. Tel. 1234/12345678 oder Tel. 1234/12345678
PC, white case, 320.- price + 62.- delivery + 95.- setup
PC, black case, 320.- price + 62.- delivery + 95.- setup
2-TB SSD, white, 200.- EUR, Tel. 1234/12345678 oder Tel. 1234/12345678
My current regex: \d+(?=(\.-)).*?
I basically want to return the digits right before the first occurrence of (.-) in the string. This is done in Java.