^([0-9]{10}-[A-Z]{3})$ --> starts with 10 characters numeric, followed by "-", followed by 3 upper-case; total 14 characters (10x number, 1x "-", 3x letter)
^([0-9]{10}-[a-z]{3})$ --> starts with 10 characters numeric, followed by "-", followed by 3 lower case letters; total 14 characters (10x number, 1x "-", 3x letter)
^([0-9A-Z]{8,10}$) --> between 8 and 10 characters, alphanumeric - upper case
- Example: 1BA1BA1B or 1BA1BA1BA or 1BA1BA1BA1
^([0-9a-z]{8,10}$) --> between 8 and 10 characters, alphanumeric - lower case
- Example: 1ba1ba1b or 1ba1ba1ba or 1ba1ba1ba1
^([0-9A-Za-z]{8,10}$) --> between 8 and 10 characters, alphanumeric - mixed case
- Example: 1Ba1Ba1b or 1Ba1Ba1bBa or 1Ba1Ba1Ba1
[0-9]{9}$ --> whatever is scanned ends with 9 numeric characters, can be preceded by multiple other things
- Example: 123456789
- Example: KSLSD123456789
- Example: 000123456789
Good resources to test regular expressions: www.regex101.com or https://regexr.com
Comments