Remove   Using Dreamweaver CC

I have an editor that is putting in many  's in the source code it is creating.  I have been unable to stop the insertion of the strings but I do need them removed.

Here is an example
<tr><td align="left" style="color: #6e6f74; font-family: Arial, Helvetica, sans-serif; font-size: 14px; padding: 0px 0px 0px 10px; text-align: left;"><a href="http://www.theherbsplace.com/onsale" style="color: #5583c7;" target="_blank"><img alt="Nature's Sunshine" src="http://image.exct.net/lib/ff2c1c757166/i/4/096bf034-0.jpg" style="border: 0px; display: block;" /></a></td><td align="right" style="color: #6e6f74; font-family: Arial, Helvetica, sans-serif; font-size: 14px; padding: 0px;" valign="middle">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <table border="0" cellpadding="0" cellspacing="0" style="border-spacing: 0px;"><tbody>

Open in new window


Please help me with a regex that will remove these extra strings.

I have tried many options using RegexBuddy but I can't seem to get it to match correctly.
(.+?)([(&nbsp;)]+)(.+?)

Open in new window

replacing with $1 $3.

This is the output I get
<tr><td alig ="left"  tyle="color: #6e6f74  fo t-family: Arial, Helvetica,  an -serif  fo t- ize: 14 x;  addi g: 0 x 0 x 0 x 10 x; text-alig : left "><a href="htt ://www.theher lace.com/o ale"  tyle="color: #5583c7 " target="_ la k"><img alt="Nature'  Su hi e"  rc="htt ://image.exct. et/li /ff2c1c757166/i/4/096 f034-0.j g"  tyle=" order: 0 x; di lay:  lock " /></a></td><td alig ="right"  tyle="color: #6e6f74  fo t-family: Arial, Helvetica,  an -serif  fo t- ize: 14 x;  addi g: 0 x;" valig ="middle">
&  
&  
&  
&  
&  <ta le  order="0" cell addi g="0" cell aci g="0"  tyle=" order- aci g: 0 x;"><t ody>

Open in new window


It seems to be ignoring I need the whole string removed but is in turn removing the single characters too.

Thanks,
sharingsunshineAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongCommented:
try create your website as a project in your DW, and then do a Find and Replace for the entire site.... (find &nbsp and replace it with blank)

Find and replace text, tags, and attributes
https://helpx.adobe.com/dreamweaver/using/find-replace-text.html
0
sharingsunshineAuthor Commented:
Thanks for getting back to me.  The only problem is that these encoded spaces don't show on Dreamweaver but they do when I transfer them to Blogger.  So I need to remove the white space that translates to &nbsp; outside of dreamweaver.

Here is a screenshot of what it looks like before I paste it into blogger.

https://gyazo.com/112d345ce98216d7ded15eb2798c93b9
0
Ryan ChongCommented:
why bother about the "white space" in HTML? it will not affect how HTML is being generated
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

sharingsunshineAuthor Commented:
I know that but when I take the source code and post it to blogger I get all of the extra &nbsp;'s that skew the way the content is presented.  If I can get a regex to remove it then the  content won't be skewed on blogger.
0
Ryan ChongCommented:
what about if you paste the content into a Notepad before copy it again from Notepad to blogger, will the blogger still adding the white spaces?

for the blogger, can you paste the content in HTML view?
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
0
sharingsunshineAuthor Commented:
I appreciate all of the suggestions but as I asked in the beginning.  I really want a regex to do the job.  Not only for this problem but for some others not specified.
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
If you want to keep the first you can use this and delete all matches
(?<=&nbsp\;)(&nbsp\;| |\n|\r)+

Open in new window

Here is demo
https://regex101.com/r/LofGmX/1
regex2.png
0
sharingsunshineAuthor Commented:
I am getting this message
https://gyazo.com/618ae12d905eaf63677a84166b23774a 

I have tried this in Dreamweaver CC and Brackets both.
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
Perhaps Dreamweaver does not support all RegEx syntaxes
0
sharingsunshineAuthor Commented:
You are probably correct but I need it to work on Dreamweaver.  So can you build one using its capabilities?
0
NerdsOfTechTechnology ScientistCommented:
try without positive look behind:
((&nbsp\;)+(\s)*?)+

Open in new window

\s matches any whitespace character (equal to [\r\n\t\f\v ])
https://regex101.com/r/LofGmX/2

http://www.adobe.com/devnet/archive/dreamweaver/articles/regular_expressions_pt1.html
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
That would remove all &nbsp;, not true?
0
NerdsOfTechTechnology ScientistCommented:
It would remove all &nbsp;'s AND whitespace if and only if preceded by &nbsp;

I created an even better RegEx for Dreamweaver CC (tested in 2018 version):

((\s)*?(&nbsp\;)+(\s)*?)+

Open in new window


It removes whitespace which proceeds and succeeds (if any) &nbsp;'s and the &nbsp;'s
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
I assume OP wants to keep one so just replace with &nbsp;?
0
NerdsOfTechTechnology ScientistCommented:
I know that but when I take the source code and post it to blogger I get all of the extra &nbsp;'s that skew the way the content is presented.  If I can get a regex to remove it then the  content won't be skewed on blogger.
-OP

I am presuming from that quote that blogger is encoding whitespace as &nbsp. Therefore, by running the RegEx OP can elect to replace &nbsp; and surrounding whitespace with nothing (erase)
replace all  's and whitespace surrounding   with NOTHINGOr, put &nbsp; in the replacement field for a single &nbsp; to replace all of the &nbsp;'s.
replace all  's and whitespace surrounding   with a single  
Even better we can make the \s greedy:

((\s)*(&nbsp\;)+(\s)*)+

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Shaun VermaakTechnical Specialist/DeveloperCommented:
extra &nbsp;
0
NerdsOfTechTechnology ScientistCommented:
In this case, greedy \s matches are better, final draft of RegEx for DW CC:

((\s)*(&nbsp\;)+(\s)*)+

Open in new window


greedy \s is better
and @Shaun please re-read the OP comment; OP is saying both whitespace (and extra &nbsp;'s, as a result of blogger's encoding) are an issue and that they should be eliminated.
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
Please reread my comments especially #a42418762, I know about the white-space and line-breaks.

My question is... Why is it okay to remove all whitespace (&nbsp; etc.)  when it repeats but leave it when there is one?
Either one needs to stay when there is a repeat -OR- all needs to be removed irrespective of repeats
0
sharingsunshineAuthor Commented:
thanks
0
sharingsunshineAuthor Commented:
Why is it okay to remove all whitespace (&nbsp; etc.)  when it repeats but leave it when there is one?

Shaun,

If I have one whitespace it is because I put it there.  If I need repeats I use CSS.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Regular Expressions

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.