Cayce Cookbook - DreamWeaver WildCard F&R


NOTE! Remember the RegEx Setting in the F/R Screen!

Remove all Elements containing a Variable

I want to remove all instances of {month}DECEMBER{/month} that will have all twelve month names inside.

Set search to "Regular Expressions".
Place [^"]* in the variable area, in this case, the month name, {month}[^"]*{/month}.
F/R with nothing.
That's it.

Basic DreamWeaver WildCard Find & Replace

A variety of WildCard F&R Options.

Set search to "Regular Expressions".
Place [^"]* in the area you want replaced.
For instance, to replace all varied instances of "images/atc_button.gif", the search criteria would look like "[^"]*/atc_button.gif".

Selects everything including instances of itself in between.

Used with great success in the coding of the Necrology Manuscripts.

<!-- Beginning Identifier -->
<!-- Ending Identifier -->

Selects all varying content between these two elements... either the document or entire site, including instances of itself in between. This one differers in that it will recognize itself, whereas the previous one deletes all instances of the intermediant tags (everything from first to last instance).

<!-- Beginning Identifier -->
<!-- Ending Identifier -->

Changing something outside a variable element.

I have a document with a multitude of hrefs that have default to a _self target because none is specified. They all have different href URLs, of course. I need to add target="_blank" to them all

If we want to add something while leaving variable content intact, this is the regex:

In the Find field:
In the Replace field:
$1 target="_blank">

The program stores everything within the pare1nths, but outside the [\w\W]+? string. On Replace, the $1 ca lls that store info into place again. I did this another time with this:

If we want to add something alongside a pre-tagged, variable a paragraph, this is the regex:

In the Find field:
(<p class="para_PN">[\w\W]+?</p>)
In the Replace with field:
$1 This is the new text being added.

Change only part of a repeated line — variable text, line to line — between two closest parameters.

Wildcard used:

Lines I needed to change are variations, all beginning with "THE HOLY CROSS":
<p><strong>THE HOLY CROSS, Titular Feast of the Diocese   (LSC)</strong></p>

Results I needed (inserting "<!--u-->" placeholder and removing closing </strong> tag:
<!--u-->THE HOLY CROSS, Titular Feast of the Diocese   (LSC)</p>

F/R wildcard setup used:
<p><strong>(THE HOLY CROSS[\s\S]*?)</strong></p>

How it works:
— All information within the parenthesis is stored when the Find is executed.
— The [\s\S]*? part of the wildcard stores all variable text from line to line to be restored sequentially in the Replace action.
— The $1 commands the system to restore the content of all within the parenthesis, both the static "THE HOLY CROSS" and each variable string represnted by the [\s\S]*? section.

Finding Numbers

In removing dates from sections of the Ordo manuscript, I needed to remove the date numbers at the end of a string. This is the string in question (the braketed items are placeholders, also being removed for this procedure):
<01><XL><02><XL><03>28 Monday</span> Advent Weekday [1]</p>

I need to remove the beginning </p>, everything in between, the trailing date numbers and the following space. The reg-ex string used:

Changing between two of the closest related elements

I was having a problem in changging data between two elements when the wildcard configuration was selecting all data between the two farthest incidents of the constants. For example, if I wanted to replace all data between <p> and </p>, the regex I was using would selact all data between the two farthest instanes of those two. I needed a regex that would confine the wildcard select to the two nearest constants. So I'm using this:

<p> [^>]* </p>

Repairing Numerous Instances of tag containing Variable Contents

I needed to replace all </strong> instances with a closing span tag.

<span style="font-weight:bold; color:#000086">([^>]*)</strong>
<span style="font-weight:bold; color:#000086">$1</span>

Had there been two variable items needing to stay intact, I would have:
<span style="font-weight:bold; color:#000086">([^>]*) & ([^>]*)</strong>
<span style="font-weight:bold; color:#000086">$1 & $2</span>