In Java, I'm attempting to parse data from an ASCII output file. A sample of the data looks is show below. The values are formatted precision 5 scale 3 and no space exists between the values.
80.234 <- 1 value
71.01663.129 <- 2 values ...
67.09159.25353.997
56.02759.77859.25057.749
55.86558.46958.64861.72855.969
What regular expression pattern can I use to match the number values and split them into groups? The pattern (\d+.\d{1,3}) matches a single value. However, with the number of groups for the line specified it does not give the expected answer. For example, I expected the following to find 10 groups.
String testPattern = "68.65761.25659.01057.67657.14857.06457.41658.77861.16268.641";
// create a pattern to match the output
Pattern p = Pattern.compile("(\\d+\\.\\d{1,3}){10}");
Matcher m = p.matcher(testPattern);
if (m.find())
{
String group = m.group();
}