I want to check if string doesn't have more than 5 numbers. I can do it this way:
Matcher matcher = Pattern.compile("\\d").matcher(val);
i = 0;
while (matcher.find()) {
i++;
}
However I would like to do it without while (because we are using regex validation framework). I want to be able to match strings like
A2sad..3f,3,sdasad2..2