我正在尝试为特定字符串编写一个正则表达式:要匹配的每个字符串应从数字[1-9]开始,并且可能包含或可能不包含前缀。
例如:
0 - not match
1 - match
9 - match
2: - not match
3:ABC - match
4:56ARD20 - match
5:56ARD20(any other chars except [0-9A-Z]) - not match
A:5GTS - not match (just a digits in the first part)
A1:GRT - not match (just a digits in the first part)
:FDE3 - not match (first part should contain only digits)
: - not match (empty first digital part)
因此,字符串的第一部分->仅是数字(强制性)。字符串可以包含一个带后缀[0-9A-Z]的符号(:)。
一只斗牛犬