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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:44:59+00:00 2026-06-04T17:44:59+00:00

I have data with several occurrencies of the following string: <a href=default.asp?itemID=987> in which

  • 0

I have data with several occurrencies of the following string:

<a href="default.asp?itemID=987">

in which the itemID is always different. I am using C# and I want to get all those itemIDs with a Regular Expression.

At first I tried this

"<a href=\"default.asp?itemID=([0-9]*)\">"

But the questionmark is a reserved character. I considered using the @ operator to disable escaping of characters. But there are still some double quotes that really need escaping. So then I would go for

"<a href=\"default.asp\\?itemID=([0-9]*)\">"

which should be translated (as a string) to

<a href="default.asp\?itemID=([0-9]*)">

But the Regex.Match method gets no success. I tried the very same regex here and it worked. What am I doing wrong?

  • 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-04T17:45:02+00:00Added an answer on June 4, 2026 at 5:45 pm

    ? and . are special chars for a regex, but can’t be escaped “as is” in a string litteral.
    So if you put one \, it will be wrong for a string, and if you don’t put \\, it will be taken as the “special char” of the regexp. So :

    "@<a href=\"default\\.asp\\?itemID=([0-9]*)\">";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataTable which I select from database (Well, these data cross several
I'm implementing several classes which does not have data by itself, just logics. These
I have a data frame with several columns, one of which is a factor
I want to have several data classes which all have an identifier that is
Let's suppose I have a data set of several hundred thousand strings (which happen
I have data for several (here: 2) plots, which both have the same x-values.
I have several data sources, each of which provides ordered timestamped data. I'd like
I have one template which consist of several pages (data-role=page). Also I have data
I have several data that looks like this: Vector1_elements = T,C,A Vector2_elements = C,G,A
I have a data-upload function that load some data into several tables and processes

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.