Dreamweaver - regular expression search and replace

Posted on 2012-08-26
Medium Priority
Last Modified: 2012-08-26
I am using Dreamweaver CS6. I am not very familiar with regular expressions. I have a folder of files, PHP, that have the following line of script that I'm trying to eliminate.

<a href="<?php echo "$whist",$num,".php"; ?>">World Hist</a><br />

however, each additional entry of this script has a +1 or +2, etc. after the $num

How can I get a search and replace to recognize all of them?
Question by:ambantin
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 800 total points
ID: 38334515
Before diving into regular expressions, I think you can do this via the Specific Tag search and replace option.  

Specific Tag lets you specify the a tag and then further specify anything that has the php string in the href attribute. The replace options allow you to delete the tag, or the tag and contents or a whole bunch of other things.  Try that first with Find All to see if you can get what you want...
LVL 10

Accepted Solution

mark_harris231 earned 1200 total points
ID: 38334611
As a matter of addressing your familiarity with regular expressions, all you would need for this particular issue is the addition of the following:


The curly brace-0-comma-1 expression is direction to match as few as zero, but no more than one instance of whatever it precedes.  Backslash-"d" (\d) means any digit 0-9).

You may also want to check out a couple of sites if you have an interest in learning more about regular expressions:



Author Comment

ID: 38334612
found a great tool... thanks for your suggestion.. will look into it next time


Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been reconstructing a PHP-based application that has grown into a full blown interface system over the last ten years by a developer that has now gone into business for himself building websites. I am not incredibly fond of writing PHP code o…
We are witnesses that everyone is saying that our children shouldn't "play" with a technology because it is dangerous. This article is going to prove that they are wrong.
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses
Course of the Month15 days, 13 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question