The first call sets the Patern to H[a-b][k-m]
The second call sets the Matcher object
The third call finds the pattern using Matcher find() method and matches "Hal" in Hallo
group() method is used to gather the returned info from find().
Joined: Jul 23, 2008
I got it now, I was having an issue with the null return types, but since the object references are never called, apart from the obj 3 which actually is a returned match group, so no worries. Its a sticky question though:
1. Why does the method have the 2nd String Var-arg argument? It doesn't look to me like it's doing anything.
2. Inside the method:
how does this statement work?
Isn't the 1st argument of the method passing the pattern, and then we're casting it into a Pattern and invoking the compile method again
Any help on understanding the logic would be helpful