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

  • Home
  • SEARCH
  • 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 4172528
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T00:34:26+00:00 2026-05-21T00:34:26+00:00

I’ve got many html-docs that need selective replacement of the <br /> tag in

  • 0

I’ve got many html-docs that need selective replacement of the <br /> tag in two specific areas in each document (400+).
I wonder how to achieve this goal and need assistance.

In each HTML-document the <br />-tag needs to be replaced only inside the html-tag:
<span property="dc:description" content="xyz1,<br /> xyz2,<br /> xyz3"/>
and also all occurences of <br />inside the alt="-tag, like in the html-tag
<img src="xyz.jpg" alt="uvw1,<br />uvw2" />)

In all other areas of the HTML-Docs the <br />-tag must remain unchanged.

…I gave this some more thought and think the problem described above may be resolved with the aid of a script or a function equipped with start- and stop-signals. This way the script knows at which positions to start looking for the <br />-tag and replace it with a given text-string AND also knows where to stop. Then move on to the next instance in documents that are open in an editor or residing in a given folder.

I am afraid that I am not capable to write such a script myself.
Hope someone can provide feedback on how to best accomplish this,
thanks.

OS: Win7-64, Editor: Notepad++

  • 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-21T00:34:26+00:00Added an answer on May 21, 2026 at 12:34 am

    Providing that your HTML files aren’t really big, I don’t think you need a script for this.

    You could just:

    1. Join the files together.
    2. Use a regex replace in Notepad++. For this you need to replace <span([^/]*)<br />(.*)"/> with <span\1NEWTAG\2"/> where NEWTAG is whatever you want to replace the <br /> with. Note that this will only replace the first <br /> it finds each time, so you will need to do this a few times until it finds no more. Therefore if you’re replacing with text that contains <br /> itself (which I doubt by the sounds of it), you’ll need to modify this a little.
    3. Split the file back up into the originals.

    Personally I’d just write a Python script, as it’s pretty ace at string manipulation. But I don’t know if this is within your scope.

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

Sidebar

Related Questions

i got an object with contents of html markup in it, for example: string
I've got a string that has curly quotes in it. I'd like to replace
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to count how many characters a certain string has in PHP, but
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I need to clean up various Word 'smart' characters in user input, including but
I have just tried to save a simple *.rtf file with some websites and
I have a JSP page retrieving data and when single or double quotes are
Seemingly simple, but I cannot find anything relevant on the web. What is 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.