javascript - Regular expression for check number and + -
sorry useless question!
i need regular expression check type of string
+7
i try .replace(/^+[0-9][^\d]/g, '') give me type of math symbols, need first symbol + second 1 number 1 - 9
your regex needs be
^\+[0-9][^\d]
if want match numbers starting + can use
/\+\d+/g
note match +73ab , return +73
if want numbers can use
/\b\+\d+\b/g
wiki
Comments
Post a Comment