Pattern.compile("J.*\\d[0-35-9]-\\d\\d-\\d\\d");
Well, compile in a pattern, but specifically this \d[0-35-9] what does it mean?. A digit between what range? 0 and 9, 0 and 35, 0 and 26? Or maybe between 0 and 3 and between 5 and 9? which seems the most logical...
It's actually two digits, the last one is not a 4.
The 'Regex101' website explains this: https://regex101.com/r/u3xKCa/1/
The section
\d[0-35-9]
means:\d
any digit[0-35-9]
Another digit, which can be in the range [0-3] or in the range [5-9]It's the same as if you put
[A-Za-z]
: means a letter in the uppercase range or a letter in the lowercase range. And it's not like you can do anything else, because the lyrics don't existZa
for there to be confusion.In short, 3 and 5 belong to different ranks within the
or
.Therefore,
[0-35-9]
it is equivalent to[0-3]|[5-9]
.