Regex for 1-9999 with zero predecessing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajkamal
    New Member
    • Aug 2012
    • 1

    Regex for 1-9999 with zero predecessing

    ^b?0*([1-9]\d{0,3}|10\d{2} )$

    it will accept from 1-9999 preceding any times zero. i.e . it will accept 0000001, 1, 1199, 9999, 0001199, 01000.

    it will not accept 0, 0000, 00000, 10000, -100, -1, -9999, 10001, ab100, 100ab etc.

    it can be verified from this tool http://tools.netshiftm edia.com/regexlibrary/#
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Is there a question here?

    Comment

    Working...