Click here to Skip to main content
15,917,320 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello to all
i need regular expression validator
to allow numbers with comaas and three number after point
like this
HTML
2,000,000.009
2,222.331
200.810

i mean i nead regular expression validator
allow any thing before pint and should input three number after point
Posted
Updated 25-May-13 22:16pm
v3
Comments
ahmed hussein khazal 26-May-13 3:36am    
any think help
ahmed hussein khazal 26-May-13 4:15am    
i find this expression
^(\d|,)*\.?\d{0,3}$
this allow only 3 number after point but it syntax allow two number after point
i need it syntax should enter three number after point

Try:
^[1-9](\d{0,2})(,\d{3})*(\.\d{3})$


^([1-9](\d{0,2})|0)(,\d{3})*(\.\d{3})

If you want to work with regexes, then get a copy of Expresso [^] - it's free, and it examines and generates Regular expressions.

[edit]:doh: - I forgot "0.123", the original expression wouldn't allow it. - OriginalGriff[/edit]
 
Share this answer
 
v2
Comments
Andreas Gieriet 26-May-13 10:13am    
My 5! This validates EN-US formatted floating point numbers with exactly three decimal digits.
Cheers
Andi
There u go buddy it allows 9 digits before point and three digits after it
^[0-9]{0,9}(\.[0-9]{0,3})?$
 
Share this answer
 
Comments
OriginalGriff 26-May-13 4:50am    
Reason for my vote of one: Please read the question. The OP wants comma delimited thousands, not just digits.
Andreas Gieriet 26-May-13 10:18am    
I agree with OriginalGriff: not answering the question and the expression . is also accepted. In addition, there is no limitation mentioned to 9 integral digits.
Andi
Swayam231 27-May-13 4:14am    
my bad!!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900