I need to write a regular expression according to the following rules:
String starts with an "A"
String continues with 4 to 6 uppercase letters "A-Z" or digits "0-9"
OR
String starts with an uppercase letter from "B-Z"
String continues with 6 digits "0-9"
The following code uses two regular expressions, one for the first case and one for the second case.
It works, but it would be better and shorter to put everything into one single regular expression. I believe it is possible because regular expressions are very powerful, but I do not know how...
Has anyone an idea how to do this?
[ April 14, 2008: Message edited by: Peter Heide ]