I'm validating phone number, it's must be "+3706 XXXXXXX"
, start with "+3706" + 8 digits
My regex is /^(+3706)(8{d})/
, but it not walidating, what is wrong
Your regex should be:
/^(\+3706) *(\d{8})$/
+
needs to be escaped in regex and to match 8 digits you need to use \\d{8}
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.