regex - regular validation expression in asp.net -
i have got code edit function. there text box in web application. using regular expression validator control validate text box. validation expression is
validationexpression="[\w]{3,15}"
it accept letters,numbers , underscores. not accept special characters \,/ * . want change above regular expression accept / .
i hope can explain above regular expression means , how change expression accept / without affecting current regular expression using asp.net , c#
you current regular expression can deconstructed follows :
[] brackets represents regular expression group. regex engine try match characters or group of characters given inside [] input string.
\w - allow alpha numberic characters includes upper case , lower case alphabets , 0 9 numbers , and underscore (this not include other special characters / or # ,etc ).
{3,15} means minimum 3 , maximum 15 alphanumeric characters must provided in order match string.
to add other charters, need add them explicitly. if want add / regex should [\w/]{3,15}.
you can learn regex here.
Comments
Post a Comment