Skip to main content
Participant
December 14, 2023
Answered

How to search and replace a link with similar code?

  • December 14, 2023
  • 2 replies
  • 1212 views

Hi,

I still use Dreamweaver 8 😉

I want to delete many, many links to amazon (including the word "amazon"). They look like this:

<a target="_blank" href="https://www.amazon.de/gp/search?ie=UTF8&tag=USERNAME&linkCode=XXXXX&camp=XXXXX&creative=XXXXX&index=sports&keywords=XXXXX" style="color:#999">amazon</a>

These "XXXXX" are always different.

How do I search&replace/delete them right?

Do I have to search for sourcecode oder text or text (extended) oder specific tag?

Can I use wildcard like " * "?

Didn't find a way 😞

THANKS from Germany!!!

    This topic has been closed for replies.
    Correct answer L e n a
    quote

    (<a[^>]*>amazon</a>)

    That will only select anchor tags with the word 'amazon' as the link text.

    By @osgood_

     

    Sorry to jump on the bandwagon only now, @osgood_ 's proposal is very good, except that the emerging part of the link must exactly be equal to amazon and containing it, if so, so far so good (no pun intended 😉 )

     

    On the other hand, @Uwe27891862d8tv if your text links could be sometimes differents, it's highly likely that your links themselves contain the word amazon in their url, so for my part, I'd suggest filtering by URL instead

     

    <a[^>]*href="[^"]*amazon[^"]*"[^>]*>.*?<\/a>

     

    2 replies

    Nancy OShea
    Community Expert
    Community Expert
    December 14, 2023

    DISCLAIMER: 

    It's nearly 2024.  As an unpaid forum volunteer and product user, I no longer field questions about OBSOLETE software from the early 2000s.  If customers cannot see fit to upgrade their tools for compatibility & security reasons,  that's their cross to bear, not mine.  

     

    MODERN OPTIONS:

    -- Adobe Dreamweaver CC - https://www.adobe.com/products/dreamweaver.html
    -- Codespaces (free, browser-based) - https://github.com/features/codespaces
    -- Nova (Mac only, formerly called Coda) - https://nova.app/
    -- Pinegrow - https://pinegrow.com/
    -- Sublime Text - http://www.sublimetext.com/
    -- Visual Studio Code (free) - https://code.visualstudio.com/
    -- Wappler ~ Visual Web App Builder - https://wappler.io/

    Good luck.

     

    Nancy O'Shea— Product User & Community Expert
    Legend
    December 14, 2023
    quote

    DISCLAIMER: 

    It's nearly 2024.  As an unpaid forum volunteer and product user, I no longer field questions about OBSOLETE software from the early 2000s.  If customers cannot see fit to upgrade their tools for compatibility & security reasons,  that's their cross to bear, not mine.  

     

     

    By @Nancy OShea

     

    It was a general question which would be applicable to any program that has a find and replace option, new or old. Theres no security or compatibility issues here. Thats like saying I'm not answering your question because you're driving a 1960s car. Of course it's your call but a little strange in the circumstances.

     

    Nancy OShea
    Community Expert
    Community Expert
    December 14, 2023

    I'm sorry but DW8 is the least reliable tool one could use.  I have no faith in it, especially when modern tools are freely available.

    https://blog.devsense.com/2022/find-and-replace-with-regexp

     

    Nancy O'Shea— Product User & Community Expert
    Legend
    December 14, 2023

     

    Back up you work folder first!!!

     

    Try:

    (<a[^>]*>.*?</a>)|amazon

     

    Edited: Actually that will just find every <a></a> tag on the page..........so you may not want to try that!

     

    This is what you want:

    (<a[^>]*>amazon</a>)

     

    That will only select anchor tags with the word 'amazon' as the link text.

     

     

    Participant
    December 16, 2023

    That's it, osgood_!

    Thank you very much!!!

     

    @Nancy OShea Thanks for your hint, I know what you mean. But I don't youse it in productivity environment.

    I used DW8 many many years ago ... and still use it sometimes for little changes. It doesn't make sence to buy/use new software for my purpuses.

    I hope, that's ok for you 😉