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

  • Home
  • SEARCH
  • 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 9077649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:25:19+00:00 2026-06-16T19:25:19+00:00

I have come across a regular expression that I don’t fully understand – can

  • 0

I have come across a regular expression that I don’t fully understand – can somebody help me in deciphering it:

^home(?:\/|\/index\.asp)?(?:\?.+)?$

It is used in url matching and the above example matches the following urls:

home
home/
home/?a
home/?a=1
home/index.asp
home/index.asp?a
home/index.asp?a=1

It seems to me that the question marks within the brackets (?: don’t do anything. Can somebody enlighten me.

The version of regex being used is the one supplied with Classic ASP and is being run on the server if that helps at all.

  • 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-16T19:25:20+00:00Added an answer on June 16, 2026 at 7:25 pm

    (?:) creates a non-capturing group. It groups things together without creating a backreference.

    A backreference is a part you can refer to in the expression or a possible replacement (by saying \1 or $1 etc – depending on flavor). You can also extract them from a match afterwards when using regex in a programming language. The main reason for using (?:) is to avoid creating a new backreference, which avoids incrementing the group number which is especially important if you’re repeating a group and do not want to have unpredictable group numbers, and saves (a usually negligible amount of) memory

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

Sidebar

Related Questions

I have come across the following regular expression in a piece of client side
I'm new to regular expression and have come across a problem. I want to
I have come across scripts that use: isset($_POST['submit']) as well as code that uses:
I have come across some legacy code that has the following type of line:
I have come across some legacy code that has raised all my heckles as
I have come across a requirement that needs to access a set of databases
If have come across an anomaly where it seems that some machines that have
I have come across a very odd problem in C that I have never
I have come across this bit of jQuery and I am failing to understand
I have come across the need to reorder a variadic list of parameters that

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.