AlgoPrefix

From SpybotWiki
Jump to: navigation, search

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.