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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:19:28+00:00 2026-05-15T01:19:28+00:00

<table > <tr> <td colspan=2 style=height: 14px> tdtext1 <a>hyperlinktext1<a/> </td> </tr> <tr> <td> tdtext2

  • 0
<table >
    <tr>
        <td colspan="2" style="height: 14px">
            tdtext1
            <a>hyperlinktext1<a/> 
        </td>
    </tr>
    <tr>
        <td>
            tdtext2
        </td>
        <td>
            <span>spantext1</span>
        </td>
    </tr>
</table>   

This is my sample text. How to write a regular expression in C# to get the matches for the innertext for td, span, hyperlinks.

  • 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-15T01:19:28+00:00Added an answer on May 15, 2026 at 1:19 am

    I cringe every time I hear the words regex and HTML in the same sentence. I would suggest checking out the HtmlAgilityPack on CodePlex which is a very tolerant HTML parser that lets you use XPath queries against the parsed document. It’s much cleaner and the person that inherits your code will thank you!

    EDIT

    As per the comments below, here’s some examples of how to get the InnerText of those tags. Very simple.

    var doc = new HtmlDocument();
    doc.LoadHtml("...your sample html...");
    
    // all <td> tags in the document
    foreach (HtmlNode td in doc.DocumentNode.SelectNodes("//td")) {
        Console.WriteLine(td.InnerText);
    }
    
    // all <span> tags in the document
    foreach (HtmlNode span in doc.DocumentNode.SelectNodes("//span")) {
        Console.WriteLine(span.InnerText);
    }
    
    // all <a> tags in the document
    foreach (HtmlNode a in doc.DocumentNode.SelectNodes("//a")) {
        Console.WriteLine(a.InnerText);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html page: <body> <div class=hide1 style=width:1000px; height:1000px;> <table width=100% border=0
I have a table as below; <tr class=nm style=height: 30px> <td style=width: 15px;>&nbsp;</td> <td
This is only happening in IE, when I place the table labelled -- middle
This HTML table is being misinterpreted by some browsers, and I cannot understand why
Is it possible to fix the height of a row (tr) on a table?
I tried this JavaScript code: dx = document.getElementById('box').style dx.backgroundColor= '#fff' dx.visibility = "visible"; dx.width
Table: UserId, Value, Date. I want to get the UserId, Value for the max(Date)
table data of 2 columns category and subcategory i want to get a collection
table { id: long name: string } 1235 Fred 1902 Trever 5123 George 6467
**Table A** 1 2 3 4 5 6 **Table B** 2 3 5 How

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.