Skip navigation
Currently Being Moderated

Find and Replace using Wildcards

May 31, 2011 2:35 PM

I am following the procedure outlined in Trent’s Blog:

 

http://www.trentmueller.com/blog/search-and-replace-wildcard-character s-in-dreamweaver.html

 

This is fantastic stuff and will really help me.

 

 

I have a few (but only a few) times had success.

 

It says to “Use regular expression.”  What does that mean?  What is an “irregular expression?”  I have tried with the box checked and unchecked.  Usually with the box checked it will not Find my string.  I uncheck the box and it sometimes does.

 

Example:

 

Link to    www.schembs.com/TEST_jds_1.html

 

 

At the moment all the Cases are identical.  I have not uploaded the .css to the site so the right-most formating is not properly displaying.  It does work when the .css is available.

 

In the source code I literally copy the line of code:

 

<p class="type_X"><u>Joh. Heinrich Sch&ouml;m (1713-1785) <span  class="right-most">1.</span></u></p>

 

and paste it into the Find box of F&R.  I then put my cursor above the line and it does not Find it, giving me the “Done.  Not found in current document.” response.  I uncheck the “Use regular expression” box and it will find it.

 

THEN,

 

I try using a wildcard (with the box checked), Finding:

 

<p class="type_X">([^<]*)< p>

 

or

 

<p class="type_X">[^”]*< p>

 

 

and it will find the misc. lines, e.g. where the text is “Case #1”, but not the lines of interest, with Heinrich’s name.  With the box unchecked it Finds nothing.

 

 

Really would appreciate help.  Thanks.

 

jds

 

 
Replies
  • Currently Being Moderated
    Jun 1, 2011 1:55 AM   in reply to jds zigzag

    It says to “Use regular expression.”  What does that mean? 

     

    http://www.regular-expressions.info/

     

    Mylenium

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2011 6:40 AM   in reply to jds zigzag

    jds zigzag wrote:

     

     

    It says to “Use regular expression.”  What does that mean?

     

    A regular expression is a pattern for matching text. It uses a combination of literal characters and special symbols or sequences of characters (technically called metacharacters or metasequences) to represent such things as the beginning and end of a line or any alphanumeric character. For example, \d represents any number (single digit), \d* represents zero or more numbers in sequence.

     

    I have written a tutorial series on using regular expressions in Dreamweaver here: http://www.adobe.com/devnet/dreamweaver/articles/regular_expressions_p t1.html.

     

    I try using a wildcard (with the box checked), Finding:

     

    <p class="type_X">([^<]*)< p>

     

    or

     

    <p class="type_X">[^”]*< p>

     

    They're not wildcards, but regular expressions. The first part matches the literal characters <p class="type_X">. The next sections use metacharacters.

     

    ([^<]*) matches zero or more characters (and as many as possible) that don't include an opening angle bracket (<). The parentheses "capture" the value that's matched so it can be used in a replace sequence.

     

    [^"]* matches zero or more characters (and as many as possible) that don't include a double quote. There are no parentheses, so the value is not captured for reuse.

     

    The closing <p> matches those literal characters.

     

    Regular expressions are not easy, but they're extremely powerful, and a good skill to acquire.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points