Monday, October 5, 2009

Use in Dreamweaver criterion expression is cleared the redundant code in file of the download that make a station: TPpabs

The static website that little younger brother uses Teleport Pro software to download a pure Html of late (hum, do not know it is appellation static website is appropriate, first such put up with are worn) . After download comes down, inside discovery much the redundancy of a lot of, issue the segment of the face for example...

Tppabs="http://www. ****.net/images/thirdkind1.gif " Class="style4">Fundamental tutorial

Gules part is redundant data, what I want to issue whole page now is all with Tppabs= begin and with the first " the attribute that is full stop is deleted, but manual operation is too slow, without efficiency, and make mistake easily still.

Use a search what I think of the first times to replace namely, the efficiency that what software can you be is highest?

The site search of use DreamweaverMX 2004 replaces a function. It is it, there still is inside we won't notice powerful function, use criterion expression. Ah, good, our tool rises to surface, looked how to be used next!

Examined a data, find following content: criterion expression is the pattern that describes character combination with text. They are used to conduce to a description in code search a few concepts, for example " with ' Var ' initial travel " and " the property that includes a number is worth " .

Next watches listed in what using in expression special character, its meaning is mixed usage give typical examples. If want to search the text of some one special character in including this list, add in front of special character please one turns over sprit, make its " transferred meaning " . For example, if want to search actual asterisk in phrase of Some Conditions Apply* , your search mode should be similar to: Apply\* . If you do not have your asterisk transferred meaning, you will be found " Apply " all matching (and " Appl " , " Applyy " and " Applyyy " all matching) , is not merely from the back with what have asterisk those match.

Character Match Give typical examples
^ The initiative part of input or travel. Does ^T match " This Good? Earth " medium " T " , but do not match " Uncle? Tom's Cabin " medium " T " .
$ The tail end of input or travel is divided. H$ matchs " Teach " medium " H " , but do not match " Teacher " medium " H "
* 0 or many before buy character. Um* matchs " Rum " medium " Um " , " Yummy " medium " Umm " and " Huge " medium " U "
+ 1 or many before buy character. Um+ matchs " Rum " medium " Um " and " Yummy " medium " Umm " , but in " Huge " in do not have any matching
? Buy character appears at most before (namely, character of the buy before the directive is optional) . St? On matchs " Johnson " medium " Son " and " Johnston " medium " Ston " , but in " Appleton " and " Tension " in do not have any matching
. Divide any only character outside line feed accord with. Does.an match phrase " Bran Muffins Can? Be Tasty " medium " Ran " and " Can "
X | Y X or Y. FF0000 | 0000FF matchs Bgcolor= " #FF0000 " medium " FF0000 " with Font Color= " #0000FF " medium " 0000FF "
{n} Apropos N before buy character. O{2} matchs " Loom " medium " Oo " and " Mooooo " before two medium " O " , but in " Money " in do not have any matching
{n, m} At least N, at most M before buy character. F{2, 4} matchs " #FF0000 " medium " FF " and " #ffffff " before 4 medium " F "
[Abc] The any character in the character that rises with bracket draw together. The character that appoints some limits with hyphen (for example, [A-f] is equivalent at [Abcdef] ) . [E-g] matchs " Bed " medium " E " , " Folly " medium " F " and " Guard " medium " G "
[^abc] Any character that did not rise in the draw together in bracket. The character that appoints some limits with hyphen (for example, [^a-f] is equivalent at [^abcdef] ) . [^aeiou] matchs at first " Orange " in " R " , " Book " medium " B " and " Eek! " medium " K "
\b The word is attrib border (for example blank space or carriage return accord with) . \bb matchs " Book " medium " B " , but in " Goober " and " Snob " in do not have any matching
\B Any content besides word border. \Bb matchs " Goober " medium " B " , but in " Book " in do not have any matching
\d Any digital character. Equivalent at [0-9] . \d matchs " C3PO " medium " 3 " and " Apartment 2G " medium " 2 "
\D Any blame number character. Equivalent at [^0-9] . \D matchs " 900S " medium " S " and " Q45 " medium " Q "
\f Form feed accord with.
\n Line feed accord with.
\r Carriage return accord with.
\s Any individual and blank character, include accord with of blank space, tabulation, form feed accord with or line feed symbol. \sbook matchs " Blue Book " medium " Book " , but in " Notebook " in do not have any matching
\S Character of any individual blame blank. \Sbook matchs " Notebook " medium " Book " , but in " Blue Book " in do not have any matching
\t Tabulation accord with.
\w Any alphabetical number character, include underline. Equivalent at [A-Za-z0-9_] . B\w* matchs " The Barking Dog " medium " Barking " and " The Big Black Dog " medium " Big " and " Black "
\W Character of any blame letter number. Equivalent at [^A-Za-z0-9_] . \W matchs " Jake&Mattie " medium " & " and " 100% " medium " % "

Use bracket is in what after the space inside expression goes out, should citing in group. Be in next " replace " use $1, $2, $3 to wait inside the country come to the first cite, the 2nd, the 3rd is mixed more the bracket from the back in group.

Be like: Replace "/main.asp? Classid=286" replaces "class(286) "

Search: / Main.asp\ ? Classid=(\d+ )

Replace: Class($1)

Attention: In " search content " \1, \2, \3 is used to wait in text casing (is not $1, $2, $3) will cite criterion the earlier bracket in expression in group.

I am below use criterion expression. Very good with:

\btppabs="h[^"]* "

Replace an operation into travel search next with respect to OK! Breathe out ah... sometimes very ordinary function, often can save time greatly for us, improve work efficiency. I hope this article can bring jade, authority is great experiment, develop and use what believe regular meeting is you bring endless advantage.

This is the mark that Teleport Pro software leaves. This software is browser leaving a line, after downloading whole webpage, it can insert Tppabs label inside picture label in order to record the primitive address of this picture. Because this label is not lawful label, so common browser is met oversight it. You can pass Element.getAttribute("tppabs") to be read in JS take this property.

Can use in DreamWeaver criterion expression batch is cleared this kind of code.
Specific write a law to be as follows:
Match Tppabs label:
\btppabs="h[^"]* "
Replace for
(Empty)
Match Javascript code: Href="javascript:iF\(confirm\('htt[^"]* "
Replace forHref=" . . / "
When the attention is replaced. Should tick off choose " to use criterion expression "
The article comes from: The guest of gain of search engine sale of why bother (Http://www.heku.org.cn/) is detailed provenance is referenced: Http://www.heku.org.cn/SEO/tppabs-Teleport.html




The file of webpage leaving a line that downloads with Teleport Pro (the download that make a station gets) in the source, included many

< Tppabs="http://www. ****.com/images/bg.gif " Style="font-size:12px; ">

And

<AHref="javascript: If(confirm('http://www.xxx.com/bbs/  \n\n file did not depend on Teleport Pro resumptive, because because wrong happening is brought about,the server reports,cannot read take.   Do you want \n\n to open it from the server? '))window.location='http: / / Www.xxx.com/bbs/' " >

Such code, teleport Pro adds these to code. Be equivalent to a specification. Clew.

Can use in DreamWeaver criterion expression batch is cleared this kind of code.

Specific write a law to be as follows:

Match Tppabs label:
\btppabs="h[^"]* "

Replace for

(Empty)

Match Javascript code:
Href="javascript:iF\(confirm\('htt[^"]* "

Replace for

Href=" . . / "

AttentionWhen replacing. Should tick off choose " to use criterion expression "

In Css file, still have a few similar/ *tpa=http://image.39.net/cancer/images/focus_bmark_bg.gif*/Such code

With criterion, such doing.

Tpa=http://[^\s]*.gif

Replace for

(Empty)

What remain next is/ **/, need not need to be being replaced.

No comments:

Post a Comment