Decode a regex to know if it allows numbers only

Viewed 887

I receive a regex as a string. Is it possible to know if the regex only permits number ? The regex I receive are mainly of the form :

  • ^[0-9]+$
  • ^[0-9]{5,10}$
  • ^[0-9]{6}$
  • ^[0-9]{1,13}\w$

But I may receive other regex.

2 Answers
Related