[英]To restrict to only Upper-case or Lower-case letteres
I have this regular expression 我有这个正则表达式
^(?:0[0-9]|1[0-3])-ARID-[0-9]{3}$
but it matches only strings like 10-ARID-278
but I want to that it should accept strings like 10-arid-257
too. 但它仅匹配
10-ARID-278
类的字符串,但我希望它也接受10-arid-257
类的字符串。
And not the strings like 10-Arid-257
or 10-ARid-257 而不是像琴弦
10-Arid-257
或10干旱-257
The literal should be either ARID or arid , not the mix of upper and lower-case. 文字应为ARID或arid ,而不是大小写混合。
Explicitly list both uppercase and lowercase word, combining them using |
明确列出大写和小写单词,并使用
|
组合 (meaning OR). (表示OR)。
^(?:0[0-9]|1[0-3])-(?:ARID|arid)-[0-9]{3}$
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.