简体   繁体   English

仅限于大写或小写字母

[英]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. 文字应为ARIDarid ,而不是大小写混合。

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM