# $EPIC: corfilter.txt,v 1.3 2007/03/02 02:32:04 jnelson Exp $
$corfilter(<string> <var1> <var2>)
The <string> argument is a dword, which is different than most functions.
This function is closely related to rfilter, which returns all of the wildcard patterns in a word list that do not match a literal string.
All of the cor* functions take a literal string, and two variable names. The first variable should contain a word list of wildcard patterns, and the second variable should contain a word list. The string is matched against each of the patterns in the first list, and depending on the result, the corresponding word in the second list is included or excluded in the resturn value.
The corfilter function returns all those words in $<var2> that correspond in position to those patterns in $<var1> that do not match the <string>.
Parsing ends whenever the shorter of the two word lists runs out of words. Therefore, the two word lists should have the same number of words.
The literal <string> may be optionally surrounded by double quotes, if the word contains spaces. The double quotes are not considered part of the string for the purposes of matching.
The words from $<var2> that correspond to all of the words in $<var1> that are not matched by <pattern>.
@ friends = [ooga!bob@*.foo.com *!tom@*.com] @ levels = [20 10] $corfilter(email@example.com friends levels) returns "10" $corfilter(firstname.lastname@example.org friends levels) returns "20"