c# - How can I validate a string to only allow alphanumeric characters in it? -


How do I verify a string using regular expressions to allow letters in letters only?

(I do not want to allow any spaces).

Use the expression:

  ^ [a-zA- Z0- 9] * $  

means: using the system. Lesson Regular expression;

  Regex r = New Reggae ("^ [A-GA-Z0-9] * $"); If (r.IsMatch (SomeString)) {...}  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -