This week's book giveaways are in the Scala and Android forums. We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line! See this thread and this one for details.
You are looking for a certain pattern in your string. There may be several substrings matching that pattern. Each call to find() will get you the next substring matching that pattern. start() will then return the index of that substring (the first character of it in the whole string) and group() will give you the substring.
The problem here is that "*" matches the empty string too.
No, I wanted to use *, the problem is not undertstanding patterns themselves, it is the output of the code that confuses me. As said, this post is obsolete, it was comitted before I managed to finish it I made another post with the same title. Please check that for my "real" question.
I'm not sure if I approve of this interruption. But this tiny ad checks out: