match
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | match [2006/08/01 20:54] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | # $EPIC: match.txt,v 1.2 2006/08/01 05:15:58 sthalik Exp $ | ||
+ | ======Synopsis: | ||
+ | $__match__(< | ||
+ | |||
+ | ======Technical: | ||
+ | * If the < | ||
+ | * <word list> contains zero or more space separated " | ||
+ | * Each word in <word list> is taken as literal text, and each are matched against < | ||
+ | * If none of the words in <word list> are matched by < | ||
+ | * Otherwise, the return value is the index of the first word in <word list> that is matched by < | ||
+ | * It is important to remember that other word functions, such as $[[word]]() count from zero. You must subtract one from the return value of this function before you can use it in some other functions. | ||
+ | * If < | ||
+ | * If <word list> contains only one word, you should use the =~ operator instead. | ||
+ | |||
+ | ======Practical: | ||
+ | This function can be used to match a pattern against a list of words | ||
+ | to see if any of them match. | ||
+ | this was the standard way to do pattern matching of one pattern to one | ||
+ | string in scripts. | ||
+ | function, this was the standard way to determine if a literal word was | ||
+ | present in a literal word list. In many cases, the __match__ function | ||
+ | has been superseded by other functions that do the job better. | ||
+ | |||
+ | ======Returns: | ||
+ | < | ||
+ | | ||
+ | >0 index to first match in list -- counting from one! | ||
+ | </ | ||
+ | |||
+ | ======Examples: | ||
+ | < | ||
+ | $match(*oo* blah foo booya) | ||
+ | $match(*oo* blah fubar erf) returns 0 | ||
+ | </ | ||
+ | |||
+ | ======History: | ||
+ | This function first appeared in ircII-2.1.5 | ||
match.txt · Last modified: 2006/08/01 20:54 by 127.0.0.1