Please notice the spaces in the regx! Anyway thank everybody who try to contribute. With spaces, it is really challenging I guess.
I saw the current code has the following:
Perl5Compiler compiler = new Perl5Compiler();
Perl5Matcher matcher = new Perl5Matcher();
Pattern pattern = compiler.compile("\\ d{ 3 } -\\d{4}.* "); // pattern for string starting with " 00 0 - 00 0 0 "
if (matcher.matches(Num, pattern)) {
return true;
}
However, I don't feel right that the "\\ d{ 3 } -\\d{4}.* "
will match " 00 0 - 00 0 0 "
. Anyone know what the real meaning of this regular expression? Or from another perspective, what's the correct regex for " 00 0 - 00 0 0 "?