I need a a regular expression to allow only one character for a textbox. Actually i want to validate a text filed to enter a single charecter for Initial (for name)
Share
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.
In a regular expression, ‘.’ (dot) matches a single character.
If you want to be sure that this single character is alphabetic, use:
or in a posix system:
[:alpha:]Now, to know exactly how to implement it, we need to know in which language your code is written.
For a starter, have a look to
http://en.wikipedia.org/wiki/Regular_expression