正则表达式每次调用失败

时间:2017-05-11 11:11:30

标签: javascript node.js regex

我有一个正则表达式检查,每次调用它都会失败。

select u.* 
from user u 
inner join friend f on u.user_id = f.friend_id 
inner join friend ff on f.user_id = ff.friend_id 
where ff.user_id = {$user_id} AND u.user_id <> {$user_id}
      AND u.user_id not in (
           select directFriend.friend_id 
           from friend directFriend
           where directFriend.user_id = {$user_id})

我尝试用const PHONE_REGEX = /^(0{0,2}|\+|[1-9])[1-9]\d{7,}$/g; const validatePhoneNumber = (telNumber) => PHONE_REGEX.test(telNumber); const input = "01695233966"; [ validatePhoneNumber(input), validatePhoneNumber(input), validatePhoneNumber(input), validatePhoneNumber(input) ] 替换validatePhoneNumber次来电,但我仍遇到同样的问题。

0 个答案:

没有答案