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

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -