Click here to Skip to main content
15,893,994 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Can any one tell me regular expression for accepting only zeros..
Posted

Try this I hope it will help you

Regular Expressions[^]

or in short you can use [0]

keep smiling :):):) happy coding:)
 
Share this answer
 
v2
/^0{1,4}$/

It Will allow you 0,00,000,0000 and if you want more zero then increase 4 to more as requried
 
Share this answer
 
u can use:
[0]{1,}
this also. which means the value contains minimum 1 zero and no max limit
 
Share this answer
 

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