I fail to extract a (double) number from a pre-defined input String using a regular expression.
The String is:
String inputline ="Neuer Kontostand";"+2.117,68";
For successfully parsing just the number I need to suppress the leading +
while keeping an optional -
. In addition I must cut off the "
before/after the number.
Of course I could do multi-step string-operations, but does anyone know how to do all in a more elegant way using one regular expression?
What I tried so far:
Pattern p = Pattern.compile("-{0,1}[0-9.,]*");
Matcher m = p.matcher(inputline);
String substring =m.group();