i have textbox and i need to check if he contain only character
how to do it with Regex in C# ?
thank’s in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The normal way to do that would be
^.$.This means only one character between the start and end anchors.
Feel free to change
.to any other limitation to suit your purposes.And keep in mind, there may be other ways to do what you want. For example, if it’s a WPF
TextBox, you can set properties on the text box itself that will restrict lengths without you having to worry about regexes.