i'm currently making a regex generator for some invoices, and I wanted to know if there is a way to know that my regular expression matched with one and only one part of the text. The regular expr itself is not really important, I just want to know if I can check there was only one match and no more.
I'm of course using `Pattern` and `Matcher` from `java.util.regex` package.
I tried to use `matcher.groupCount()` but that doesnt seem to do the trick because it involves group count not the matches count.
 Thanks in advance for your answers.