RashedRahat :
My regex:/[0-9]{5,15}/
that satisfies a number e.g. 8801778620485
which is fine. But it also satisfies a number i.e 8801778620485|123456|987123456
(Three parts are a single phone number). I don't want this kind of phone number to be accepted. I want exclusively numbers without any special characters like (|, ?, *, -
) these no special characters are allowed, only numbers are allowed.
Anuj Pancholi :
number.match(/^\d{5,15}$/);
This should work \d
for [0-9]
, and start and end of the expression specified so that a a string like 123456|12345678
doesn't result in a partial match.