rmatch
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | rmatch [2006/08/29 20:18] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | # $EPIC: rmatch.txt, | ||
+ | ======Synopsis: | ||
+ | $__rmatch__(< | ||
+ | |||
+ | ======Technical: | ||
+ | * If the < | ||
+ | * <pattern list> contains zero or more space separated " | ||
+ | * Each pattern in <pattern list> is taken as a wildcard pattern, which is matched against < | ||
+ | * If none of the patterns in <pattern list> match < | ||
+ | * Otherwise, the return value is the word from <pattern list> for the pattern which " | ||
+ | * The return value begins counting words FROM ONE, like [[match]]. | ||
+ | * If none of the patterns in <pattern list> contain wildcards, then you should use the $[[findw]]() function instead. | ||
+ | * If <pattern list> contains only one word, you should use the =~ operator instead. | ||
+ | |||
+ | ======Practical: | ||
+ | This function can be used to match a bunch of patterns against a single | ||
+ | literal word. This is often used to match the $[[userhost | ||
+ | function|userhost]]() value against a list of userhosts in an access | ||
+ | list. Since ircII does not include the =~ operator, this was the | ||
+ | standard way to do pattern matching on one word against one string in | ||
+ | scripts. | ||
+ | this was the standard way to determine if a literal word was present in | ||
+ | a literal word list. The $__rmatch__() function is still generally | ||
+ | useful for matching one word against a list of patterns. | ||
+ | |||
+ | ======Returns: | ||
+ | < | ||
+ | | ||
+ | >0 index to " | ||
+ | </ | ||
+ | |||
+ | ======Examples: | ||
+ | < | ||
+ | $rmatch(one o* t* f*) | ||
+ | $rmatch(one z* t* f*) | ||
+ | $rmatch(one o* on* t* f*) | ||
+ | </ | ||
+ | |||
+ | ======History: | ||
+ | This function first appeared in ircII. | ||
rmatch.txt · Last modified: 2006/08/29 20:18 by 127.0.0.1