That depends on what you mean by faster. You can make the code a little more efficient by using start(int)
instead of group(int)
if(matcher.start(i) != -1){
If you don't need the actual content of the group, there's no point trying to create a new string object to hold it. I doubt you'll notice any difference in performance, but there's no reason not to do it this way.
But you still have to write the same amount of boilerplate code; there's no way around that. Java's regex flavor is severely lacking in syntactic sugar compared to most other languages.