> Hi newsgroup,
>
[quoted text clipped - 14 lines]
>
> Frank
Use a regular expression: [A-Z]{3}-\d{6}
In a Java string literal you have to escape the backslash, so this would
become
if ( Pattern.matches("[A-Z]{3}-\\d{6}", theStringToCheck) ) {
// accepted
} else {
// rejected
}
<http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html>

Signature
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
Frank Meyer - 27 May 2005 17:35 GMT
Roland,
> Use a regular expression: [A-Z]{3}-\d{6}
once again: heavy thanks :o)
Best regards
Frank