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 7659443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:20:01+00:00 2026-05-31T13:20:01+00:00

I’ve created an email validator for ASP.NET with a 100 Character limit. It all

  • 0

I’ve created an email validator for ASP.NET with a 100 Character limit. It all worked fine and then I did a refresh like 20 minutes later and I’m getting the following error.

parsing “[\w+([-+.]\w+)@\w+([-.]\w+).\w+([-.]\w+)]{0,100}” – [x-y] range in reverse order. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: parsing “[\w+([-+.]\w+)@\w+([-.]\w+).\w+([-.]\w+)]{0,100}” – [x-y] range in reverse order.

So my code is <asp:RegularExpressionValidator ID="emailReg" runat="server" ControlToValidate="email" ValidationExpression="[\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*]{0,100}" Text="&nbsp;<img src='err.png' alt='*' title='Please enter a valid email address less than 100 characters long'>" ErrorMessage="Please enter a valid email address less than 100 characters long"></asp:RegularExpressionValidator>

Can any one tell me what’s suddenly gone wrong? I haven’t changed anything.

  • 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-05-31T13:20:02+00:00Added an answer on May 31, 2026 at 1:20 pm

    The regex probably wouldn’t have worked in the first place – it’s probably not valid, and certainly not doing what you expect it to.

    By including your entire regex in the character class [ ]{1,100}, everything within that character class is not interpreted as a regex, but instead as contents of a character class.

    That is, your regex matches 0 to 100 of \w,+,*,(,… etc.

    The error comes from the hyphens within: if I do a regex [a-z], it means “match all characters between a and z (inclusive)”.

    Your regex has [-+ and [-., all within the []{0,100}. So, you’re trying to say “match all characters between [ and +“. This is defined by the unicode character. The left square bracket [ has unicode 91, whilst + is unicode 43.

    The error message you are getting is because you’re trying to select all characters between unicode points 91 and 43, which is back to front.

    Anyhow, to fix your regex, take it out of the [].

    \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
    

    To enforce the 100 character limit in regex, you’ll have to use a lookahead:

    ^(?=.{0,100}$)\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$
    

    The ^(?=.{0,100}$) makes sure there are at most 100 characters in the string. If this is true, the rest of the regex then proceeds to validate it.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.