Search replacement features using Dreamweavermx2004 improve work efficiency.

xiaoxiao2021-03-06  53

Using regular expressions in Dreamweaver MX 2004

The younger brother recently downloaded a pure HTML static website using Teleport Pro software (um, I don't know if it is right for static websites, first this will be.). Download

After that, I found a lot of redundant information in it, such as the following pieces ...

TPPABS = "http://www.***.net/images/thirdkind1.gif" class = "style4"> Basic tutorial

The red part is an extra data, I now want to delete all the tops of the entire page and starting with the first "" to the attribute of the terminator, but the manual operation is too slow, no

Efficiency and easy error.

What I first think of is to use search replacement, but what software can be the highest?

Use the site search of Dreamweavermx 2004 Search Alternative. It is it, there is another one we will not pay attention to powerful features, use regular expressions. Oh, ok,

Our tools come out of the water, and then look at how to use it!

Check out the information, find the following:

Regular expression is a mode in combination with text description characters. Use them in code search help to describe some concepts, such as "rows starting with 'Var'" and "containing numbers

Sex value.

The following table lists the special characters used in the regular expression, its meaning and usage examples. To search for text containing a particular character in the table, please add it in front of the special character.

A backslash, to "escape". For example, if you want to search the actual asterisk in a Some Conditions Apply * phrase, your search mode should be similar to: apply / *.

If you don't make an astrology escape, you will find all matching items of "Apply", "AppL", "ApplyY", "ApplyY", not just behind

Those match items with aster numbers.

character

match

Example

^

The starting portion of the input or row.

^ T Match "T" in "THIS Good Earth", but does not match "T" in "Uncle Tom's Cabin".

$

The end of the input or row.

H $ matches "H" in "TEACH", but does not match "H" in "TEACHER"

*

0 or more preamble characters.

UM * "UMM", "U" in "UM", "Yummy" in "rum", "u" in "huge"

1 or more preamble characters.

Um Match "UMM" in "Rum" in "UMM" in "Yummy", but there is no match in "huge"

?

The front character appears up to once (ie, indicating the front character is optional).

ST? ON matches "SON" and "Johnston" in "Johnson", but there is no match in "Appleton" and "Tension"

.

Any single character outside the charter.

"Ran" and "CAN" in the phrase "BRAN MUFFINS CAN Be Tasty"

X | Y

X or Y.

FF0000 | 0000FF Match BGColor = "# ff

0000 "

"Ff"

0000 "

"0000FF" in font color = "# 0000ff"

{n}

Just n pre-character.

O {2} Match the first two "o" in "oo" in "LOOM", but there is no match in "Money"

{n, m}

At least n, at most M preamp, character.

F {2, 4} matching "#FF

0000 "

The first four "f" in "ff" and "#ffffff" in "#ffffff"

[ABC]

Use any of the characters in characters parenthery. Specify a range of characters (for example, [A-F] equivalent to [ABCDEF]) with a hyphen.

[E-g] Match "F" and "G" in "Fol" in "BED" in "Fol" [g "[^ ABC]

Any character that is not enclosed in parentheses. Specify a range of characters (for example, [^ A-F] equivalent to [^ Abcdef]) with a hyphen.

[^ aeiou] "K" in "B" and "EEK!" in "R", "Book" in Orange "," K "in" R "," Book "in" ORANGE "

/ B

Word boundary (such as spaces or carriage return).

/ BB matches "B" in "BOOK", but there is no match in "GoOBer" and "Snob"

/ B

Anything other than the word boundary.

/ BB matches "B" in "GOOBER", but there is no match in "BOOK"

/ d

Any number of characters. Equivalent to [0-9].

/ d Match "C3PO" "" "

3 "

And "Apartment

2G

"middle"

2"

/ D

Any non-numeric character. Equivalent to [^ 0-9].

/ D Match "S" and "Q" in "900S"

45 "

"Q"

/ f

Change the page.

/ N

Removal.

/ r

Enter.

/ s

Any single blank character, including spaces, tabs, change, or newline.

/ Sbook matches "BOOK" in "Blue Book", but there is no match in "Notebook"

/ S

Any single non-blank character.

/ Sbook matches "Book" in "Notebook", but there is no match in "Blue Book"

/ t

Tabs.

/ w

Any alphanumeric characters, including underscore. Equivalent to [A-ZA-Z0-9_].

B / W * "BiG" and "BLACK" in "Barking" and "The Big Black Dog" in "BiG Black Dog"

/ W

Any non-alphanumeric characters. Isometrically equivalent to [^ A-ZA-Z0-9_].

/ W Match "&" and "100%" in "Jake & Mattie"

The packets to be referenced later in the regular expression in the regular expression. Then use $ 1, $ 2, $ 3 in the "replace" domain to reference the first, second, third, and more

Braces packets.

Note: Use / 1, / 2, / 3, etc. (rather than $ 1, $ 2, $ 3) in the "Find Content" text box to reference your earlier brackets in the regular expression.

Here is the regular expression I use. very useful:

/ btppabs = "h [^"] * "

Then the search replacement operation is OK! Oh ... Sometimes it is very inconspicuous, often can save time to save us and improve work efficiency. I hope this article can lead

Jade, everyone trial, I believe you will have endless convenience to your development and use.

转载请注明原文地址:https://www.9cbs.com/read-114930.html

New Post(0)