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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:40:51+00:00 2026-05-16T20:40:51+00:00

Content is &nbsp;&nbsp;&nbsp;&nbsp;Hello World. <a&nbsp;href=#&nbsp;target=_blank>hello&nbsp;World</a> How to replace the &nbsp; in html code and

  • 0

Content is

&nbsp;&nbsp;&nbsp;&nbsp;Hello World.

<a&nbsp;href="#"&nbsp;target=_blank>hello&nbsp;World</a>

How to replace the &nbsp; in html code and keep the other &nbsp; in the text.

  • 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-16T20:40:51+00:00Added an answer on May 16, 2026 at 8:40 pm

    Can you try searching for

    (?<=<[^>]*)&nbsp;
    

    and replacing it with a single space?

    This looks for &nbsp; inside tags (preceded by a < and possibly other characters except >).

    This is extremely brittle, though. For example, it will fail if you have </> symbols in strings/attributes. Better avoid getting those &nbsp; into the wrong locations in the first place.

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

Sidebar

Related Questions

i have two links <a href=page1.html>page 1</a> <a href=page2.html>page 2</a> <div id=content>&nbsp;</div> 1. I
I have a Html document of the following format. <p>&nbsp;&nbsp;&nbsp;1. Content of the paragraph
I have a load of content as shown below: <td width=20%><a href=/search?tbs=shop:1&q=camping+lantern&sampleq=1>camping&nbsp;lantern</a></td> <td width=20%><a
Similar to this question How replace all spaces inside HTML elements with &nbsp; using
I have a ColdFusion script that does: <cfset content = replace(content,&##147;,,all)> Which replaces &147;
HTML: <ul> <li><a href=#tab1>tab1</a></li> <li><a href=#tab2>tab2</a></li> </ul> <div id=tab1 class=tab-content>content 1</div> <div id=tab2 class=tab-content>content
Here is my html: <form> <dl> <dt>&nbsp;</dt> <dd><input type=hidden></dd> <dt>Dont hide this one</dt> <dd><input
I have a file with this content: foo:&nbsp;bar1 foo:&nbsp;bar2 foo:&nbsp;bar3 foo:&nbsp;bar4 foo:&nbsp;bar5 I want
<div id=m101> <table class=tablec width=80% border=0 cellspacing=0 cellpadding=0> <tr> <td><a href=#><span class=name>My Name</span></a></td> <td>&nbsp;</td>
I am extracting a field on a webpage ad the tag html text content

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.