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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -