asp.net - Regex for Range $5,000 - $1,000,000 (with commas and dollar sign optional) -


i need creating regex number range of 4,000-1,000,000 commas , dollar sign being optional user.

i'm trying annotate validation departments budget using asp.net regular expression or custom validator permits optional dollar sign , commas range $5000.00 $1,000,000

^\$?([5-9][0-9]{3,5}|1000000)$ 

sadly, didn't work it's came with, appreciated!

is solid choice, if notice ending more simple way being of second 1 down below ,? make shorter in length.

^(?:5,?\d{3}|[6-9],?\d{3}|[1-9]\d{1,2},?\d{3}|1,000,000|1000000)$ 

vs

^\$?([5-9],?\d{3}|\d{2,3}?,?\d{3}|(?:1,?000,?000))$ 

the second 1 lot cleaner , can tell works fully.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -