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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:09:57+00:00 2026-05-11T07:09:57+00:00

I need to find a certain chunk from a group of HTML files and

  • 0

I need to find a certain chunk from a group of HTML files and delete it from them all. The files are really hacked up HTML, so instead of parsing it with HtmlAgility pack as I was trying before, I would like to use a simple regex.

the section of html will always look like this:

<CENTER>some constant text <img src=image.jpg> more constant text:   variable section of text</CENTER> 

All of the above can be any combination of upper and lower case, and notice that it is img src=image.jpg and not img src=’image.jpg’… And there can be any number of white space characters in between the constant characters.

here are some examples:

    <CENTER>This page has been visited  <IMG SRC=http://place.com/image.gif ALT='alt text'>times since 10th July 2007 </CENTER> 

or

    <center>This page has been visited  <IMG src='http://place.com/image.gif' Alt='Alt Text'>  times since 1st October 2005</center>  

What do you think would be a good way to match this pattern?

  • 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. 2026-05-11T07:09:57+00:00Added an answer on May 11, 2026 at 7:09 am

    How much of that text is needed to uniquely identify the target? I would try this first:

    @'(?is)<center>\s*This\s+page\s+has\s+been\s+visited.*?</center>' 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to find all the zipcodes with a certain range from a zipcode.
I need to find records in a dataset that have certain values from more
I need to read an html file and find a certain paragraph tag, with
in ruby/rails3, I need to do some heavy text parsing to find a certain
I need to find the highest value from the database that satisfies a certain
I need to find a <div> with certain content and click it from Selenium,
I took over someones job and need to find out from where certain tables
I need to find all schools with contains a certain emailaddress in a string
I need to find a date after a certain number of weeks. For example,
I need to find all the occurences of a file Test.TXT in c:\ or

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.