Difference between revisions of "AlgoPrefix"
(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...) |
|||
Line 16: | Line 16: | ||
* ''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 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]]). | ||
+ | |||
+ | ==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 Command|commands]]. |
Revision as of 11:44, 18 February 2008
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 <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 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).
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.