Tuesday, 15 September 2015

asp.net - Regarding Applying validation in textbox through Regular Expression -



asp.net - Regarding Applying validation in textbox through Regular Expression -

i trying apply validation in textbox command limiting empty space in control. next regular look code i'm using:

regularexpression validationexpression="^[^-\s][a-za-z0-9_\s-]+$" errortext="" />

now requirement is:

user should not come in empty space in begining. (working fine) textbox limit upto 10 numbers, user able come in much number wants, no validation if come in less 10 numbers. (working fine.) validation should prompt if user come in numbers "111 111 ", means show validation if there empty space between numbers. (not working)

currently i'm using next regular look accomplish thing, please allow me know or update regular look can accomplish requirement.

regularexpression validationexpression="^[^-\s][a-za-z0-9_\s-]+$" errortext="" />

^[a-za-z0-9_-]{1,10}$

try this.see demo.

http://regex101.com/r/wq1ow3/23

asp.net .net regex devexpress

No comments:

Post a Comment