Regex help for ##.#.##.## -


i'm not sure how double digit regex numbers

this have far [01-99]\.[0-4]\.[01-99]\.[01-99]

the following should validate:

  • 99.3.24.53
  • 01.0.0.0
  • 14.0.0.0
  • 14.0.01.01
  • 14.01.01.1

any letter should not validate, no slashes either. numbers , periods in specific format ##.#.##.##

any appreciated!

this matches of examples:

\d{2}\.0?[0-4]\.\d{1,2}\.\d{1,2} 

i'm not sure how double digit regex numbers

if ok leading zeroes: \d{1,2}

if not ok leading zeroes, it's little more complicated: ^[1-9]\d$|^[1-9]$. part before pipe handles numbers 10-99. part after pipe handles numbers 1-9. number 0 or 04 not match.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -