简体   繁体   中英

Match fourth character of string(phone number) using regular expression

我想检查字符串(电话号码)的第四个字符是否在7,8,9之间,如何使用正则表达式做到这一点?下面是要检查的示例电话号码。

+9198714356

Try this one:

\+\d{2}[789]\d{9}

https://regex101.com/r/HM01ug/4

希望这对你有用

\+\d{2}[789]\d{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