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

Find and Replace Advanced - Replace only Matched Text

Community Beginner ,
Jun 27, 2017 Jun 27, 2017

Hi folks,

I cannot figure out a way to use advanced search to do what I used to do with it; namely make code changes across my site quickly and easily. If anyone can help me figure out how to replace only the matched text within a tag found through advanced search, I will be truly grateful.

I am attempting to change all hyphens found in a span we use for item #s to the code for a non-breaking hyphen. Finding them is no problem, this search pulls them up. However replacing them is what's stumping me. I don't seem to have the ability to only replace the hyphen - my only relevant option seems to be to replace all the contents of the tag.  What I want to do is leave everything except the hyphen as is. The rest of the text is different in each case, so I can't replace all contents.

Any ideas?

1.5K
Translate
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

correct answers 1 Correct answer

Adobe Employee , Jul 28, 2017 Jul 28, 2017

Hi,

We can of-course replace a particular string in the inner html of the tag without touching its outer html. I can better explain you with the example below:

1. I am trying to replace "hey" with "HELLO" in the Design view text of <p> tag only.

2. I am making use of the filter "Search Text only" which makes a Design view Search and as you can see below, it hasn't touched any other instance other than the one in inner html of <p> tag.

Hope this helps. I am still expecting that you will share the que

...
Translate
Adobe Employee ,
Jun 28, 2017 Jun 28, 2017

Hi,

As per your snapshot, you are not trying to find text containing hyphen, you are finding all tags containing the hyphens. For or better understanding, can you please copy a code snippet from you file showcasing the initial state and the result that you want? That will make us help you better.

Regards,

Niharika Gupta

Adobe dreamweaver

Translate
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 Beginner ,
Jul 03, 2017 Jul 03, 2017

Hi Niharika,


Thanks for the reply!

Correct, we are looking for hyphens in any tag with class "itemNumber". The regular hyphen character can cause problems on some devices, so we want to replace with the non-breaking hyphen like so:

(Original)

<span class="itemNumber">SKU-SAMPLE</span>

(Desired)

<span class="itemNumber">SKU&#8209;SAMPLE</span>

Fortunately, a fellow employee still has Dreamweaver 2015 on her machine, so I was able to borrow her computer to run the find and replace.  Still, I would like to be able to do it without leaving my office!

Thanks for any help,

Translate
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 ,
Jul 03, 2017 Jul 03, 2017

Hi,

The tag search in Find and Replace dialog now as per Dw 17.5 works exactly the same as it used to in Dw CC 2015, I assure you there is no change at all. So can you share the search and replace query that you used in CC 2015 which worked and is not working in CC 2017.5?

Although, we now have one more option to search in [any tag], please use the settings as per the snapshot below and see if this works?

Regards,

Niharika Gupta

Adobe Dreamweaver

Translate
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 Beginner ,
Jul 05, 2017 Jul 05, 2017

Hello Niharika,

In your example, wouldn't that replace all hyphens in ANY span with the code?  We only wish to replace hyphens within spans that have the class "ItemNumber".

Translate
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 ,
Jul 05, 2017 Jul 05, 2017

Hi,

Yeah, this will replace any hyphen that is there in the "Design view" text in any span tag. For your specific case, I am not able to formulate the exact query from the Find and replace options that are available.

Although, you mentioned that you were able to fulfill it through CC 2015, so I was wanting to understand the query that you used there.

Regards,

Niharika Gupta

Adobe Dreamweaver

Translate
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 Beginner ,
Jul 07, 2017 Jul 07, 2017

Yes, that is my point.

In older Versions of Dreamweaver, you could search for a specific string

within a specific tag.

I don't find anyway of doing that in the new one.

I will try and get a screenshot of the old one when I get back to the

office in a week.

Thank,

Translate
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 ,
Jul 10, 2017 Jul 10, 2017

Hi,

You can still search for a specific string in inner and outer html of a tag through the Find and Replace dialog, there is no denying in this fact.

That is why I wanted to see the query that worked for you in CC 2015 and is not working in CC 2017, did you get any luck in getting us the screenshot?

Regards,

Niharika Gupta

Adobe Dreamweaver

Translate
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 Beginner ,
Jul 12, 2017 Jul 12, 2017

Hi,

Yes, that's true - but can you replace only part of a string in a

specific tag and leave the rest? I don't see how....

Translate
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 ,
Jul 28, 2017 Jul 28, 2017
LATEST

Hi,

We can of-course replace a particular string in the inner html of the tag without touching its outer html. I can better explain you with the example below:

1. I am trying to replace "hey" with "HELLO" in the Design view text of <p> tag only.

2. I am making use of the filter "Search Text only" which makes a Design view Search and as you can see below, it hasn't touched any other instance other than the one in inner html of <p> tag.

Hope this helps. I am still expecting that you will share the query which used to run in CC 2015 and is not working in CC 2017.

Regards,

Niharika Gupta

Adobe Dreamweaver

Translate
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