I need a good and best RegExp for validate Iranian phone number like this:
0903*******
0918*******
in this RegExp should check the user should just start phone number with 0 not other things like area code (+98)
try it:
("^[0][9][0-9][0-9]{8,8}$")
Using case in js:
const IsValidPhone = (val) => { let regex = new RegExp("^[0][9][0-9][0-9]{8,8}$").test(val); return regex; };
You can use this regex:
/^(09)[0-9]{9,9}$/gu