I have the following return:
EXCEPTION, ClassException, EXCEPTION, Exception Message
I'd like to get the number of times the String EXCEPTION
appears using Regex .
I used the following code:
Pattern.compile("(EXCEPTION)",Pattern.DOTALL).matcher(aString).groupCount()
But it returns me 1
. Does anyone know what can be done?
Note: I know you can parse and count the amount in a loop .
Is there any better way to address this problem?