Dw (dreamweaver) Regular Expression Function list

Source: Internet
Author: User

I just used teleport pro to pull a whole site to the local. All the superchains were forcibly added with tppabs = "... "the newly installed system and dreamweaver 8 have used the dw replacement function to search for the entire local site: source code: \ btppabs = "h [^"] * "Replace: (null) Check: replace all buttons with regular expression points. OK ~~ Done ~~

Example 2: Contains brackets, single quotes, etc.

Search: href = "javascript: if \ (confirm \('(.*?) '\) Window \. location = '(.*?) '"
Replace: $1

Later, I shared an article about dw Regular Expressions in more detail. I guess you will like the Dreamweaver regular expression character search replacement method ($1, $2 instructions)

In addition, the dw Regular Expression table is attached.

Character

Match

Example

^

The start part of the input or line.

^ T matches "T" in "This good earth", but does not match "T" in "Uncle Tom's Cabin ".

$

The end of the input or line.

H $ matches "h" in "teach", but does not match "h" in "teacher"

*

0 or multiple prefix characters.

Um * matches "um" in "rum", "umm" in "yummy", and "u" in "huge"

+

One or more preconditions.

Um + matches "um" in "rum" and "umm" in "yummy", but there is no match in "huge"

?

The prefix can appear at most once (that is, it indicates that the prefix is optional ).

St? On matches "son" in "Johnson" and "ston" in "Johnston", but there are no matching items in "Appleton" and "tension ".

.

Any single character except line breaks.

. An matches "ran" and "can" in the phrase "bran muffins can be tasty"

X | y

X or y.

FF0000 | 0000FF matches "0000FF" in "FF0000" and "font color =" # 0000FF "in" # FF0000"

{N}

Exactly n prefix characters.

O {2} matches the first two "o" in "loom" and "mooooo", but there is no match in "money"

{N, m}

At least n and at most m prefixes.

F {2, 4} matches the first four "F" in "# FF0000" and "# FFFFFF"

[Abc]

Any of the characters enclosed in parentheses. Use a hyphen to specify a range of characters (for example, [a-f] is equivalent to [abcdef]).

[E-g] matches "g" in "e" in "bed", "f" in "folly", and "guard"

[^ Abc]

Any character not enclosed in parentheses. Use a hyphen to specify a range of characters (for example, [^ a-f] is equivalent to [^ abcdef]).

[^ Aeiou] initially matches "B" and "eek!" in "r" and "book" in "orange !" "K" in"

\ B

Word boundary (for example, space or carriage return ).

\ Bb matches "B" in "book", but there are no matches in "goober" and "snob"

\ B

Any content beyond the word boundary.

\ Bb matches "B" in "goober", but there is no match in "book"

\ D

Any number character. It is equivalent to [0-9].

\ D matches "2" in "3" and "apartment 2G" in "C3PO"

\ D

Any non-numeric character. It is equivalent to [^ 0-9].

\ D matches "S" in "900S" and "Q" in "Q45"

\ F

Page Break.

\ N

Line Break.

\ R

Carriage return.

\ S

Any single blank character, including space, tab, break, or line break.

\ 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

Tab.

\ W

Any letter, digit, or underscore. It is equivalent to [A-Za-z0-9 _].

B \ w * matches "barking" in "the barking dog" and "big" and "black" in "the big black dog"

\ W

Any non-alphanumeric character. It is equivalent to [^ A-Za-z0-9 _].

\ W matches

Search for all hyperlinks, excluding http: // and/
\ Shref \ s * = ["'] [^ (http) (/)]

Href \ s * = ['] [^ (http) (/)]

Href \ s * = (["']) ([^ (http) (/)])

Href = $1/$2

The regular expression replaces or adds different content.

For example, add <a hrefpolic'wholesale-wedding-dresses.html '>/
You need to group the data to be searched in parentheses in the search box, such as href \ s * = (["']) ([^ (http) (/)])
Use href = $1/$2 in the replacement box.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.