is any way to validate phone number in two forms? I would like to validate numbers beginning with "+" and phone without "+". For example, it should pass numbers +238472636 and 193785626.
Pattern: /^[\+]\d+$/
is any way to validate phone number in two forms? I would like to validate numbers beginning with "+" and phone without "+". For example, it should pass numbers +238472636 and 193785626.
Pattern: /^[\+]\d+$/
The ? quantifier matches the preceding element zero or one time. It is equivalent to {0,1}. ? is a greedy quantifier whose lazy equivalent is ??
so your reg. ex would be like this..
/^[\+]?\[0-9]+$/ OR
/^[\+]?\d+$/