📌  相关文章
📜  正则表达式来验证给定的输入是否是有效的印度手机号码 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:24.555000             🧑  作者: Mango

代码示例1
//Create a regular expression to validate if the given input is valid Indian mobile number or not

const number = '+919876543210';

function validateMobile(number) {
    const regEx = /^(\+91|0)?( )?(\d{10})$/
    return regEx.test(number)
}

console.log(`is a valid Indian mobile number: ${validateMobile(number)}`)