Copy link to clipboard
Copied
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?
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
...Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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‑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,
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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".
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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,
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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....
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now