number of matches regex java
// Java 9+
long matches = matcher.results().count();
// Java 8-
int count = 0;
while (matcher.find())
{
count++;
}
Are there any code examples left?
New code examples in category Java
// Java 9+
long matches = matcher.results().count();
// Java 8-
int count = 0;
while (matcher.find())
{
count++;
}