Answers for "how to count the number of values in pattern matcher in java"

0

number of matches regex java

// Java 9+
long matches = matcher.results().count();

// Java 8-
int count = 0;
while (matcher.find())
{
	count++;
}
Posted by: Guest on June-16-2020

Code answers related to "how to count the number of values in pattern matcher in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language