This is a example for SCJP for Java Platform, SE6 STUDY GUIDE by Richard F. Raposa and can be found at page 317.
In the books is write
The pattern matches any word that starts with any character between ‘ q ’ and ‘ v ’ (the [qrstuv] ) repeated any number of times (the “ * ” ), followed by any single character (the . ), and ending with the literal string “ ing ” . Using the tests array from the previous examples, the matches are
ring matches [qrstuv]*.ing
trying matches [qrstuv]*.ing
In my compilatin, the return was:
ing matches [qrstuv]*.*ing
ring matches [qrstuv]*.*ing
trying matches [qrstuv]*.*ing
running matches [qrstuv]*.*ing
"*" does mean "repeated any number of times" including zero times. So, for the other two cases, where the word doesn't start with "q" to "v", the regex engine matches it zero times. This allows the "." to match the first character instead.