Alex
Alex

Reputation: 77329

Constrain ASP.NET MVC Route Parameter Value (Exactly 1 Letter A-Za-z)

How can I constrain an MVC route parameter to be only A-Za-z and exactly 1 letter? (Looking for the validation Regex). Thank you!

Upvotes: 0

Views: 148

Answers (1)

Fragsworth
Fragsworth

Reputation: 35497

^[A-Za-z]$            

Upvotes: 1

Related Questions