Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Find and replace with wildcards

New Here ,
Mar 30, 2017 Mar 30, 2017

Copy link to clipboard

Copied

Hello all.  I'm new to Dreamweaver, and I've tried to find the answer on my question, but to no avail.

I am looking to use Find and Replace to delete extraneous code not needed in the projects I am working on.  Even though this is specifically having to do with bolding text, I'm not sure how to approach it because of the variables needed.

An example would be this:

<span style="font-family: Arial, sans-serif;

  mso-fareast-font-family: 'Times New Roman';

  mso-font-kerning: 18.0pt; mso-bidi-font-weight: bold;

  font-weight: bold;">ABCD</span>

would need to be changed to this:

<span style="font-weight: bold;">ABCD</span>

Or this:

<span style="line-height: 115%;

  font-family: Arial, sans-serif; font-weight: bold;">ABCD</span>

to:

<span style="font-weight: bold;">ABCD</span>

The problem I'm having is to somehow make sure that if font-style: is included in the style, it is not omitted.  E.g.

<span style="font-weight: bold; font-style: italic;">

In this case, I would need the search string to be able to leave the italicized formatting.  Would anyone have any ideas?  Maybe a replace string that leaves all instances of font-weight and font-style?  If it helps at all, these pages have already been developed in RoboHelp.  But with over 13,000 pages, it would take a while to do it all by hand.

Views

1.1K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 30, 2017 Mar 30, 2017

Copy link to clipboard

Copied

Or better yet, how about removing ALL inline styles and using <strong> and <em> tags for bold and italic?    No <span> tags needed.

Search for:  <font

Hit Find ALL

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

The problem with this is that since the original source is RoboHelp, and future articles are going to be created using it (Dreamweaver is used for more advanced features solely.)

When bolding in RoboHelp, the code it creates is the <span> code I displayed earlier.

At this point, I'm trying to create consistency in the projects I've been working on.  If I change everything to <b> or <strong>, then at some point they will all be reverted back as they get updated.

Either way, how would I do a Find and Replace to overwrite the code that is currently in there while not ignoring font-style:?  Because italics and bold are not the only styles in the project.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

That depends on how good you are with RegEx statements.

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

Is no one able to help me out?  I've briefly tried studying RegEx, but I'm finding it difficult to come up with the search I need for this particular case.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 12, 2017 Apr 12, 2017

Copy link to clipboard

Copied

LATEST

Hi,

Thanks for reporting the issue.

Using regular expressions should be able to do the operation.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines