简体   繁体   中英

Check the 3 first characters of a string

鉴于'052 ....',我需要检查前两个字符是'05'而第三个是0到9之间但不是1.我试过:

var regex = /^[05]+[0,2-9]/;

差不多了 :

var regex = /^05[02-9]/;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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