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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:47:15+00:00 2026-06-03T03:47:15+00:00

I have a corrupt html-page which i unfortunately can’t parse with xml/xcode so i

  • 0

I have a corrupt html-page which i unfortunately can’t parse with xml/xcode so i came up with regex. I’m a regexbeginner but I cant get the right result.

Source

<td>FIELD:</td> <td>VALUE<td>

I want to get the value and this is where I’m stuck

$regex = '{<td[^>]*<td>(.*?)</td>}';

edit: as a result I want an array where I can reach the value, so I’m just interested in the value

I’m thankfull for every hint.

cheers endo

  • 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-03T03:47:16+00:00Added an answer on June 3, 2026 at 3:47 am

    There are some immediately visible problems with your regex; for example, <td[^>]*<td> doesn’t do what you think it does. But rather than suggest a different regex, let me urge you to do the sanest thing:

    Don’t use regex for this!

    Trust me. Don’t do it. Others will come in here and suggest new regex patterns, and their patterns will all be wrong. Regex isn’t even up to the task of parsing clean HTML/XML, so trying to use it on arbitrarily corrupted code is a recipe for madness. Try HTML Tidy, which is made for this sort of thing. Depending on what’s wrong with the HTML, a parser like HtmlPurifier or Beautiful Soup might also be able to work with it.

    It may seem like a little more effort, but you’ll save yourself time in the long run.

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

Sidebar

Related Questions

I have a file which contains corrupt XML, There are some garbage characters at
I have a sqlite3 database in which I have corrupt data. I qualify corrupt
I have a HTML-page, that's encoded in ISO-8859-1 and a Prototype-AJAX call that's build
I suspect I have corrupt mergeinfo but I'm not sure. Does anyone know how
In the below code, I have a corrupt hello.bz2 which has stray characters beyond
I have a situation where there is a corrupt WAV file from which I'm
I have a seemingly corrupt h2 database. I can use org.h2.tools.Recover to get a
We have a 3rd party web application which works on in IE6, but not
Update : The problem appears to have been corrupt DLLs somewhere in my PHP
I have what appears to be a corrupt index? Here is what is happening.

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.