Click here to Skip to main content
15,915,501 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Having multiline textbox that accept case id in 1234,2345 format help of using below expression "^\d*[0-9](|.|,|:|-|_|;|#\d*[0-9]|\s)*$"
to avoid alphabets in multiline textbox but accept special characters which is configure from web.config file. above expression working fine.but when i am put value like 1234sdfg format it gives me error so how to avoid this scenario with above one
Posted

1 solution

I think if the requirement is to allow the input in the format 1234,2345 then the following ValidationExpression
(\d+,)*\d+ for any number of digits in each set
and
(\d{4},)*\d{4} for exactly four number of digits in each set
may suffice.
 
Share this answer
 
v2
Comments
ravijain03 18-Apr-12 6:57am    
Thanks Brother.
VJ Reddy 18-Apr-12 7:06am    
Thank you for the response.
If your question is answered, then you may consider to accept and vote the solution.
ravijain03 19-Apr-12 1:48am    
hi VJ it is working fine on first line on multiline textbox but fail to work when enter valid 4 digit case id on next line.
VJ Reddy 19-Apr-12 2:28am    
Use the following expression
(\d+,\r?\n?)*\d+
(\d{4},\r?\n?)*\d{4}
It matches , entered at the end of the line.
Hope, this may serve the purpose.
Thank you.

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