posted
We used to use a 3rd party photo print service. We no longer do so, and I need to remove the specialized URLs that still refer to it from our website. There are a few thousand of them.
Dreamweaver allows regular expressions in its search and replace function, but as far as I can tell there is no way to use a single wildcard to find a variable amount of text.
What regular expression would I use that could find all of these chunks of code?
| <a href="http://fictitioussite.com/perl/ptp/oursite?photo_name=/downloads/photoname040408.JPG&title=Photo caption">BUY THIS PRINT</a>
| <a href="http://fictitioussite.com/perl/ptp/oursite?photo_name=/special/woohoohoo/otherphotoname072309.JPG&title=Other photo caption">BUY THIS PRINT</a>
| <a href="http://fictitioussite.com/perl/ptp/oursite?photo_name=/otherotherphotoname121206.JPG&title=Other other photo caption">BUY THIS PRINT</a>
The domain name is the same, the closing code is always the same, but after that the URLs are of wildly varying lengths and characters, and as far as I can tell DW's regex only handles single characters. Any suggestions?
I can also use Homesite or another text editor if that would help. Anything beats manually editing thousands of pages.
Posts: 7790 | Registered: Aug 2000
| IP: Logged |
Note: not tested, but should be about right. There could be a thing or two you'd want to escape, though the . in ".com" likely isn't one of them (too specific a location to matter).
Posts: 15770 | Registered: Dec 2001
| IP: Logged |
posted
What I want to do is find all those URLs and remove them entirely. so that
Photo by Photographer Name | <a href="http://fictitioussite.com/perl/ptp/oursite?photo_name=/downloads/photoname040408.JPG&title=Photo caption">BUY THIS PRINT</a>
becomes
"Photo by Photographer Name"
Posts: 7790 | Registered: Aug 2000
| IP: Logged |
posted
If Dreamweaver has the usual regexp options as fugu says, then I'm confused about what the problem is. Can you give some detail on what you've tried so far, and what result you got that you didn't like?
Posts: 10645 | Registered: Jul 2004
| IP: Logged |
posted
That should be easy, then. Just add more surrounding stuff to the first regex, then put nothing in the replace field and do a full search/replace.
Posts: 15770 | Registered: Dec 2001
| IP: Logged |
(Assuming that there are no links you want to keep to that site and path which are preceded by a vertical bar and a space.)
Posts: 884 | Registered: Mar 2005
| IP: Logged |
That was the first one I tried when I got in this morning, so fugu13's may work just as well. I'll try that elsewhere (first one is still replacing).
Posts: 7790 | Registered: Aug 2000
| IP: Logged |
posted
Mine wouldn't work for what you want without tweaking as I indicated, which would basically make it Shmuel's.
Posts: 15770 | Registered: Dec 2001
| IP: Logged |