Regex for min 9 numbers -


i'm trying make javascript regex match:

  • required: 9 or more numbers.
  • optional: dash, forward slash, plus , space characters.
  • forbidden: other character

so far have

^[0-9-+\/\s]{9,}$ 

the problem (i think) counts non numeric permitted characters along reach minimum 9.

how can amend counts numbers reach minimum 9?

if want solve in single re (not recommended, useful):

^[-+\/\s]*([0-9][-+\/\s]*){9,}$ 

or, if want first , last characters digits:

^[0-9](^[-+\/\s]*[0-9]){8,}$ 

that's: digit, followed 8 or more runs of optional characters, each ending digit.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -