I\'m try to write a regular expression to use in a Java program that will recognize a pattern that may appear in the input an unknown number of times. My silly little exampl
(Similar question: Regular expression with variable number of groups?)
This is not possible. Your best alternative is to use h.t, and use a
h.t
while (matcher.find()) { ... ... matcher.group(1); ... ... }
The feature does exist in .NET, but as mentioned above, there's no counterpart in Java.