Reputation: 7525
Do I need to use regex to ensure that the user has typed in English? All characters are valid except non English characters.
How do I validate this textbox?
Upvotes: 1
Views: 1603
Reputation: 15262
This has nothing to do with regular expressions and the link referred to by gurukulki does not answer the question either. To change language, you need to implement localization in your website:
http://www.west-wind.com/presentations/wwdbResourceProvider/introtolocalization.aspxlink text
http://www.codeproject.com/KB/aspnet/localizationByVivekTakur.aspx
Upvotes: 0
Reputation: 66162
A regex would work quite well for this. Something like
^[a-zA-Z0-9 ?!.,;:$]*$
would be a good starting point. It would allow all alphabetical and numerical characters, as well as some common punctuation. You would need to change it depending on what your definition of English characters is.
See the regex docs here for more information.
Upvotes: 6