I am processing text using Java Regexes (1.6) which contain quantifiers and I wish to return the number and values of matched groups. A simple example is:
A BC DEF 1 23 456 7 XY Z
which is matched by:
([A-Z]+){0,9} (\d+){0,9} ([A-Z]+){0,9}
How can I find the number of each capture (here 3 4 2) and the values ("A", "BC", "DEF", "1", "23", "456", "7", "XY", "Z"). The regexes are created outside the program though I can design them to tackle this problem if possible.