Quote:
Originally Posted by alykins
I don't know all the BI rules of your validation, but this regex should work for you
^([a-z][A-Z]{0,1})+\d{1,8}
|
That's not correct, Alykins. Not really even close.
That reads:
-- no characters BEFORE what follows (good)
-- a lower case letter
-- FOLLOWED by an optional upper case letter (huh???)
-- that pattern (lower then optional upper) repeated 1 *OR MORE* times
-- followed by from 1 to 8 digits
-- any number of any kinds of characters AFTER the preceding.
So that expression would *ACCEPT*:
s11111111 (as expected)
cZ3xx@#$--+111BB (after the \d{1,8}, *ANYTHING* is allowed)
s33333333333333333333333333333333333333333333 (8 digits accepted, but with no limit on what follows them)
aBcDeFgHiJKlMn4 (lower upper repeated any number of times, 1 digit minimum okay)
zzzzzzzzz77777777 (lower [no optional upper] repeated)
and many others.
From what he posted, I think it should be:
^[a-zA-Z]\d{8,8}$
Which reads:
-- no characters BEFORE what follows
-- one letter, either upper or lower case
-- followed by exactly 8 digits
-- no characters AFTER the preceding.