The most complete use of regular bulk removal Teleport Pro Whole station download files redundant code _ Regular expression

Source: Internet
Author: User
Tags numeric alphanumeric characters

Tppabs

The tppabs tag in the HTML original file is a mark left by the Teleport Pro software. The software is an offline browser, after downloading the entire page, it inserts a tppabs label inside the picture or hyperlink label to record the original address that the picture or hyperlink points to. Because the label is not a legitimate label, the normal browser ignores it. However, this property can be read in JS by Element.getattribute ("Tppabs").

If we manually clear it, it would be an incalculable amount of work that needs to be cleared in bulk. It is easier and quicker to use Dreamweaver regular expression to remove tppabs labels in batches.



The method is as follows:

Using the DW replacement feature:
Find scope: Entire current local site
Search: Source code
Find: \btppabs= "h[^"]* "
Replace: (empty)
TICK: Use regular expressions
Point Replace All buttons




Match JavaScript code:
<a href= "javascript:if (Confirm (' http://www.xxx.com \ n \ nthe file was not retrieved according to teleport Pro because the server reported an error that could not be read. \ n \ ndo you want to open it from the server? ') window.location= ' http://www.xxx.com ' ">

The method is as follows:
Find scope: Entire current local site
Search: Source code
Find: Href= "javascript:if\" (confirm\ (' htt[^ "]*")
Replace: href=www.xxx.com
TICK: Use regular expressions
Point Replace All buttons

Note: If the expression contains a different URL, you can use If\ (confirm\ (' htt[^ ']*\) (note that other code uses this syntax expression) to match the part without the URL and replace it with NULL.


CSS files have some similar/*tpa=http://www.xxx.com/test.gif*/code

The method is as follows:
Find scope: Entire current local site
Search: Source code
Find: \/\*tpa=http://[^\s]*\/
Replace: Empty
TICK: Use regular expressions
Point Replace All buttons

Character The Example
^ The starting part of the input or line. ^t matches "T" in "This Good the Earth", but does not match "T" in "Uncle Tom's Cabin".
$ The end part of the input or line. h$ matches "H" in "teach", but does not match "H" in "Teacher"
* 0 or more preceding characters. um* matches "Umm" in "um", "Yummy" in "Rum" and "U" in "huge"
+ 1 or more preceding characters. um+ matches "Umm" in "um" and "Yummy" in "Rum", but there are no matches in "huge"
? The preceding character appears at most once (that is, indicates that the preceding character is optional). St?on matches "Ston" in "Son" and "Johnston" in "Johnson", but there are no matches in "Appleton" and "Tension"
. Any single character except a newline character. "Ran" and "can" in a matching phrase "bran muffins can be tasty"
X|y x or Y. FF0000|0000FF matches "0000FF" in "FF0000" and Font color= "#0000FF" in Bgcolor= "#FF0000"
N Exactly n a preceding character. O{2} matches the first two "O" in "oo" and "mooooo" in "loom", but there are no matches in "money"
{N,m} At least N, at most m, preceding characters. f{2,4} matches the first four "F" in "FF" and "#FFFFFF" in "#FF0000"
[ABC] Any one of the characters enclosed in parentheses. Specifies a range of characters with hyphens (for example, [a-f] is equivalent to [abcdef]). [E-g] matches "G" in "F" and "guard" in "E", "Folly" in "bed"
[^ABC] Any character that is not enclosed in parentheses. Specifies a range of characters with hyphens (for example, [^a-f] is equivalent to [^abcdef]). [^aeiou] Initially matches the "B" and "eek!" in "Orange" in "R", "book" "K" in the
\b Word boundaries (such as spaces or carriage returns). \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 are no matches in "book"
\d Any numeric character. equivalent to [0-9]. \d matches "2" in "3" and "Apartment 2G" in "C3PO"
\d Any non-numeric character. is equivalent to [^0-9]. \d matches "Q" in "S" and "Q45" in "900S"
\f Page breaks.
\ n Line feed.
\ r The carriage return character.
\s Any single whitespace character, including spaces, tabs, page breaks, or line breaks. \sbook matches "book" in "Blue Book", but there are no matches in "notebook"
\s Any single non-white-space character. \sbook matches "book" In "Notebook", but there are no matches in "Blue Book"
\ t Tabs.
\w Any alphanumeric characters, including underscores. 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. is equivalent to [^a-za-z0-9_]. \w matches the "Jake&mattie" in the

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.