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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:10:28+00:00 2026-05-29T05:10:28+00:00

I am trying to define the regular expression required for my ASP.NET validator to

  • 0

I am trying to define the regular expression required for my ASP.NET validator to run properly. Currently with the expression below I am able to properly validate the following sample string in firefox but not in IE

12{2}12{0-9}1{12,13}

using

(({\d+\})*|(\d)*|({(\d+,)+\d+\})*|({(\d+)\-(\d+)\})*)+

After doing some research it seems that this is due to the lookahead bug but since I am fairly new to using regex I do not understand how I can modify it properly to work around the bug?

Please feed me with higher knowledge!!

EDIT:
The expression must match these three optional individual component that can be in the string in any order. I tried to come up with an expression describing each individual component and then merging them into a single expression.

{n} regex {\d+\}  to match sample {423} optional digits

{n,n,n} regex {(\d+,)+\d+\} to match sample set of digit {24,25,26}

{n-n} regex {(\d+)\-(\d+)\} to match sample range of {0-9}

individual digits (\d) to match sample 232

EDIT 2:
In the end I will be using this expression and a special thanks to woohoo

((\d*\#*\**)*\{((\d*\#*\**)+|(\d*\#*\**)+\-(\d*\#*\**)+|((\d*\#*\**)+\,)+(\d*\#*\**)+)\}(\d*\#*\**)*)+

the expression supports digits # and * at every position.

  • 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-29T05:10:29+00:00Added an answer on May 29, 2026 at 5:10 am

    I’m afraid the regular expression you posted above has some errors, and it looks too complicated for what you try to achieve. I would do it this way:

    \d+\{(\d+|\d+\-\d+|\d+\,\d+)\}
    

    eventually you can add the + sign to match one or more of these,

    (\d+\{(\d+|\d+\-\d+|\d+\,\d+)\})+
    

    or, if you want to match a specific number of those, use {m,n} quantitative expression:

    (\d+\{(\d+|\d+\-\d+|\d+\,\d+)\}){3,}
    

    In this case I made it to match exactly 3 pieces.

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

Sidebar

Related Questions

I'm trying to define a new shortcode in WordPress, and I get the following
I'm using ASP.NET MVC 2.0 and I am trying to take advantage of the
I'm banging my head against a wall with a regular expression. I'm trying to
I'm trying to get a line of code in my ASP.net application (using Visual
So I am trying to write a regular expression that will match a defined
Im trying to define a dataTemplate for a business object in my wpf application
I'm trying to define a task that emits (using echo) a message when a
I'm trying to define a table to store student grades for a online report
I am trying to define a WCF contract that returns an interface, something like
I'm trying to define a delegate function that will return an IEnumerable. I'm having

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.