I was trying to extract my data from a string by using regular expression.
My data looks like:
12 170 0.11918
170 12 0.11918
12 182 0.06361
182 12 0.06361
12 198 0.05807
198 12 0.05807
12 242 0.08457
242 12 0.08457
11 30 0.08689
30 11 0.08689
The problems here are the different number of whitespace between two numbers.
All in all i want to extract from each line two Integers and one Double. Therefore i tried to use regular expressions.
Pattern p = Pattern.compile("(([0-9]+.[0-9]*)|([0-9]*.[0-9]+)|([0-9]+))");
Matcher m = p.matcher(" 6 7781 0.01684000");
while (m.find()) {
System.out.println(m.group(0));
}
I now my regular expression doesn't work. Has anyone some help for a suitable regular expression therefore i can work with the data or any other help for me?