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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:02:58+00:00 2026-05-16T00:02:58+00:00

I have a HTML document with the a table which I want to replace,

  • 0

I have a HTML document with the a table which I want to replace, however I don’t know what the content of the table will be so I need to search for the opening and closing table tags and then replace the content between them. I’m a bit of a n00b with regular expressions so I’m having trouble working out how to do this… any ideas?

Update: The HTML in question is available to me as a string and I’m not able to insert any extra data or change the HTML in any way… I need to be able to search for a opening and closing pattern at the start and end of the table in the HTML and then replace the contents in-between. 🙂

  • 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-16T00:02:58+00:00Added an answer on May 16, 2026 at 12:02 am

    Do NOT use regular expressons for this, look into parsers. For instance, load the HTML in a DOMDocument instance, search the table with either DOMXPath or getElementsByTagName, and use the replaceNode or other manipulation functions. Doing it with regexes is usually very unreliable.

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

Sidebar

Related Questions

I have an HTML document as a string I want to search for a
This is what I want to know. I have a table which has the
I have a html document and I want to delete all the divs of
I have a HTML table which I add items to from javascript on an
I have a html table which if filled by values of an mysql table.
I have a HTML table inside which I have a submit button. Now, I
I have written a script which dynamically creates a html table based off server
I have got a HTML table which contain a check box in <TH> and
I have a table and I want from user add rows which who want.
On my page I have a search form which generates a table for the

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.