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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T23:29:44+00:00 2026-05-11T23:29:44+00:00

I am trying to build a regular expression to extract the text inside the

  • 0

I am trying to build a regular expression to extract the text inside the HTML tag as shown below. However I have limited skills in regular expressions, and I’m having trouble building the string.

How can I extract the text from this tag:

<a href="javascript:ProcessQuery('report_drilldown',145817)">text</a>

That is just a sample of the HTML source of the page. Basically, I need a regex string to match the “text” inside of the <a> tag. Can anyone assist me with this? Thank you. I hope my question wasn’t phrased too horribly.

UPDATE: Just for clarification, report_drilldown is absolute, but I don’t really care if it’s present in the regex as absolute or not.

145817 is a random 6 digit number that is actually a database id. “text” is just simple plain text, so it shouldn’t be invalid HTML. Also, most people are saying that it’s best to not use regex in this situation, so what would be best to use? Thanks so much!

  • 1 1 Answer
  • 2 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-11T23:29:45+00:00Added an answer on May 11, 2026 at 11:29 pm
    <a href="javascript:ProcessQuery\('report_drilldown',[0-9]+\)">([^<]*)</a>
    

    This won’t really solve the problem, but it may just barely scrape by. In particular, it’s very brittle, the slightest change to the markup and it won’t match. If report_drilldown isn’t meant to be absolute, replace it with [^']*, and/or capture both it and the number if you need.

    If you need something that parses HTML, then it’s a bit of a nightmare if you have to deal with tag soup. If you were using Python, I’d suggest BeautifulSoup, but I don’t know something similar for C#. (Anyone know of a similar tag soup parsing library for C#?)

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

Sidebar

Related Questions

I have been trying to build a regular expression but haven't been able to
I'm trying to build a Java regular expression to match .jar! The catch is
I'm trying to create regular expression that filters from the following partial text: amd64
I'm trying to build a regular expression that will detect any character that Windows
I am trying to build a regular expression to replace unresolved velocity variables with
I am trying to build a regular expression in javascript that checks for 3
I am trying to build a regular expression to match any git read+write URL
I'm trying to match the parts of a version number (Major.Minor.Build.Revision) with C# regular
I need to build a regular expression for all nonempty sequences of letters other
i have been trying to build the Qt Driver for 2 weeks now ,

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.