Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7800537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:40:13+00:00 2026-06-02T00:40:13+00:00

I use RegularExpressionValidator control to verify TextBox control named TextBox1, the web form in

  • 0

I use RegularExpressionValidator control to verify TextBox control named TextBox1, the web form in VS2003 Web application, like below:

<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" ErrorMessage="Fromat error."
 ValidationExpression="^(?=.*[0-9])(?=.*[a-zA-Z]).{8,10}$" ControlToValidate="TextBox1"></asp:RegularExpressionValidator>

When I input string “qwer1asd”, it does not match. But the same regular expression:

^(?=.*[0-9])(?=.*[a-zA-Z]).{8,10}$

…matches in JavaScript. How do I fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:40:15+00:00Added an answer on June 2, 2026 at 12:40 am

    Try this regex:

    ^(?=.{8,10}$)(?=.*[0-9])(?=.*[a-zA-Z]).+$
    

    There’s a bug in older versions of Internet Explorer (described here) that caused a regex like this to fail in the client even though it worked on the server. (That sounds like the opposite of what you’re describing, but I don’t see any other reason why your regex would fail.) Moving the length check to the first lookahead is the proven workaround for the bug.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use ASP.NET and C#. I have a RegularExpressionValidator control on a Web Form
Is it possible to use asp:RequiredFieldValidator and asp:RegularExpressionValidator for a single textbox.
<asp:RegularExpressionValidator ID=RegularExpressionValidator1 runat=server ControlToValidate=txtPassword ErrorMessage=can not use this password Font-Bold=True ForeColor=White ValidationExpression=(?=^.{8,}$)(?=.*\d)(?=.*\W+)(?![.\n]).*$> </asp:RegularExpressionValidator> What
What RegularExpressionValidator.ValidationExpression should I use to allow only ICQ UIN like input? xxx-xxx-xxx and
I am trying to use the RegularExpressionValidator Control in Visual Studio to validate a
I have an Asp.Net website and I want to use a RegularExpressionValidator to check
Use Html element SELECT in aspx page like: <SELECT id=MySelection name=MySelection runat=server DataValueField=ID DataTextField=Name></SELECT>
I want to use an ASP.NET RegularExpressionValidator to limit the number of words in
When I use the .Net RegularExpressionsValidator control the Validation expression matches EXACT text. When
I'm trying to use a RegularexpressionValidator to match an IP address (with possible wildcards)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.