Home > Article > Backend Development > Regular verification of mobile phone number problem
if (!preg_match('/0?(00|01|11|13|14|15|17|18)[0-9]{9}/', $tel)) {
<code> } </code>
Why does this regex allow mobile phone numbers with more than 11 digits to pass through directly without reporting an error? 00 and 01 11 are customized, just ignore them
The regex is not very good. What is wrong? How should I write it?