first character of the textbox should not special character in RegularExpressionValidator

First character of the textbox should not special character, what code I have to write  in ValidationExpression= "  " of  RegularExpressionValidator
LVL 22
Tapan PattanaikSenior EngineerAsked:
Who is Participating?
 
Carl TawnConnect With a Mentor Systems and Integration DeveloperCommented:
OK, try it as:
^[A-Za-z0-9].*

Open in new window

0
 
Carl TawnSystems and Integration DeveloperCommented:
Try:
'/^[a-zA-Z0-9].*$/'

Open in new window

0
 
Tapan PattanaikSenior EngineerAuthor Commented:
It is not working. Please check the code.

VALID: Test VALID: Hello123
 VALID: 456 Hi
 VALID: 456-789
 VALID: Hi-777
 VALID: 333-Hi
 VALID: Hello-There
 VALID: What's Up
 VALID: Hello#Goodbye
 
INVALID: -Hello
INVALID: &Goodbye


                                            <asp:RequiredFieldValidator ID="refName" runat="server" ErrorMessage="Enter Name"
                                                ControlToValidate="txtName" Display="Dynamic" CssClass="valMsg"></asp:RequiredFieldValidator><asp:RegularExpressionValidator
                                                    ID="revtxtName" runat="server" ErrorMessage="Invalid Name" ControlToValidate="txtName"
                                                    Display="Dynamic" ValidationExpression="/^[a-zA-Z0-9].*$/" CssClass="valMsg"></asp:RegularExpressionValidator>

Open in new window

0
 
Tapan PattanaikSenior EngineerAuthor Commented:
100% working. Thank You so much.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.