I need to ectract a double out of a String. The problem is, that the String looks like this:
"13,05 €"
Now I tried to extract just the number, using regex.
Double.parseDouble(test.getAmount().replaceAll("\\D+", ""));
As u can see, there is one problem. By using \D+ the ',' also will be replaced and I don't get the correct amount. Now I thought about how to fix this. Guess I need something like: "Replace all non-digits, but ,". But I can't figure out, how to express that with regex. Does someone have an idia?