Click here to Skip to main content
15,906,333 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want expression allow not only numeric ,mean allow number and all thing but should have at least one letter

What I have tried:

C#
<asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="Company"
                    ValidationExpression="[!0-9]" ErrorMessage="at least one letter"
                    Display="none" />
Posted
Updated 5-Nov-16 23:37pm
v2

1 solution

If you want at least one letter, then it's trivial:
[a-zA-Z]
Will match any text which contains at least one alphabetic character.
If you want at least one letter-or-number, then that's simple too:
\w
Will match any message containing at least one alphanumeric character.
If that isn't what you are looking for then you need to give us better examples of "good" and "bad" text to check for.

It's also worth getting a Regex tool: I use Expresso[^] - it's free, and it examines and generates Regular expressions.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900