Difference between revisions of "AlgoPrefix"

From SpybotWiki
Jump to: navigation, search
(New page: Algo prefixes allow you to use various string matching algorithms to identif patterns of text. ==Examples== <wc>Hall? Welt <substr>Hallo <bool>Hallo OR Hello <bool>Hallo AND Welt <re...)
 
m (Algorithms: updated adv file param examples)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
Algo prefixes allow you to use various string matching algorithms to identif patterns of text.
+
Algo prefixes allow you to use various string matching algorithms to identify patterns of text.
  
 
==Examples==
 
==Examples==
Line 15: Line 15:
 
* ''bool'' means boolean comparisons and allows you to use OR and AND to combine various substrings.
 
* ''bool'' means boolean comparisons and allows you to use OR and AND to combine various substrings.
 
* ''regexpr'' allows you to use the full power of [http://en.wikipedia.org/wiki/Regular_expressions regular expressions]. You can do nearly anything that way, but take care, regular expressions do cost processing time!
 
* ''regexpr'' allows you to use the full power of [http://en.wikipedia.org/wiki/Regular_expressions regular expressions]. You can do nearly anything that way, but take care, regular expressions do cost processing time!
* ''bm'' stands for the [http://en.wikipedia.org/wiki/Boyer-Moore Boyer-Moore string seach algorithm], a power algorithm, most effectively used to search in large texts (you'll also find this algorithm used in the ''textinstream'' and ''bininstream'' [[Advanced file parameters|advanced file parameters]]).
+
* ''bm'' stands for the [http://en.wikipedia.org/wiki/Boyer-Moore Boyer-Moore string seach algorithm], a powerful algorithm, most effectively used to search in large texts (you'll also find this algorithm used in the [[findtext(searcharea)| findtext[searcharea]]] and [[findbinary(searcharea)|findbinary[searcharea]]] [[Advanced file parameters|advanced file parameters]]).
 +
 
 +
==Combining rules==
 +
Regular expressions are a very powerful tool, and often used for extracting partial information. ''AlgoPrefix'' does allow re-using results from regular searches as well, in the form of ''<$REGMATCH0>'' to ''<$REGMATCH10>'' templates that can be used nearly everywhere in standard [[SBI Commands|commands]].

Latest revision as of 17:15, 24 February 2008

Algo prefixes allow you to use various string matching algorithms to identify patterns of text.

Examples

<wc>Hall? Welt
<substr>Hallo
<bool>Hallo OR Hello
<bool>Hallo AND Welt
<regexpr>[Hh]allo Welt
<regexpr>[a-zA-Z]* Welt
<bm>Hallo

Algorithms

  • wc stands for wildcards and is usually the default if no prefix has been specified. Wildcards are ? (for none or one letter) or * (for one or any larger amount of letters). Much like you might know from console command lines.
  • substr stands for substring search and means that any text that includes the specified text will be identified as a match. This is a weak algorithm, open to errors, so use with care if at all.
  • bool means boolean comparisons and allows you to use OR and AND to combine various substrings.
  • regexpr allows you to use the full power of regular expressions. You can do nearly anything that way, but take care, regular expressions do cost processing time!
  • bm stands for the Boyer-Moore string seach algorithm, a powerful algorithm, most effectively used to search in large texts (you'll also find this algorithm used in the findtext[searcharea] and findbinary[searcharea] advanced file parameters).

Combining rules

Regular expressions are a very powerful tool, and often used for extracting partial information. AlgoPrefix does allow re-using results from regular searches as well, in the form of <$REGMATCH0> to <$REGMATCH10> templates that can be used nearly everywhere in standard commands.