Well, this question has more to do with regular expressions than Java... Anyways I'll try to define what the Regex "J.*\\d[0-35-9]-\\d\\d-\\d\\d" means.
.* will match any number of any characters, \\d matches any digit, so the expression will match any string that has a J followed by anything (matched by J.*)
followed by a single digit (matched by \\d),
followed by another digit, which is between 0 and 3 or 5 and 9 (that is any digit except 4) (matched by [0-35-9]
(You should ask the reason is behind this kind of matching to the author of the program :confused: )
followed by a '-' followed by two digits, another '-' and two digits. (\d\d-\d\d)
So this regex matches
"Jane's Birthday is 05-12-75\n"
and "Joe's Birthday is 12-17-77"
But it doesn't match: "Dave's Birthday is 11-04-68\n" (No match for the J.*)
or "John's Birthday is 04-28-73\n" (No match for [0-3][5-9])