Dreamweaver - regular expression search and replace

Posted on 2012-08-26
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
    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

    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

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
    Do you hate spam? I do, and I am willing to bet you do as well. I often wonder, though, "if people hate spam so much, why do they still post their email addresses on the web?" I'm not talking about a plain-text posting here. I am referring to the fa…
    The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: :…
    The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…

    794 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now