All Numbers can be allowed
A number can have zero or more digits in front of a single period (.) and it can have zero or more digits following the period. Perhaps: [0-9]*\.[0-9]* will do ...
A number may not contain a period at all. So, revise the previous expression to:
[-+]?[0-9]*\.?[0-9]*
At least one letter allowed
Basically this means:
Zero or more digits;
One alpha character;
Zero or more alphanumeric characters.
^\d*[a-zA-Z][a-zA-Z0-9]*$
No All Characters Allowed
Explanation:
^ matches the start of the string.
[A-Za-z]* matches 0 or more letters (case-insensitive) -- replace * with + to require 1 or more letters.
, matches a comma followed by a space.
$ matches the end of the string, so if there's anything after the comma and space then the match will fail.
^[A-Za-z]*, $
Ex:
<asp:TextBox ID="txtName" runat="server"/>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" />
<asp:RegularExpressionValidator ID="regexpName" runat="server"
ErrorMessage="This expression does not validate."
ControlToValidate="txtName"
ValidationExpression="^[A-Za-z]*, $" />
Get more
Info[
^]