c# - How to make a regex pattern in Razor/MVC3 to exempt certain characters -


i know how write pattern regex in razor/mvc3. have been searching how write pattern since didn't know mvc/razor found regex pattern

characters ^[a-za-z]+$  numbers ^[0-9]*$  character , numbers ^\w+$  email address.  /\s+@\s+\.\s+/ 

those patterns found not 1 looking for. create pattern exempt these characters "&';,<>. thought of 1 way doing it. this:

^[a-za-z0-9_!#$%()-=~^|+and on..]*$ 

do have list characters exempt those? or there more efficient way of doing it?

(posted on behalf of op).

i have used @"^[^"" & ';,<>]*$" suggested simon in comments, , worked.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -