copattern
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | copattern [2007/03/02 02:32] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | # $EPIC: copattern.txt, | ||
| + | ======Synopsis: | ||
| + | $[[copattern]](< | ||
| + | |||
| + | ======Description: | ||
| + | The < | ||
| + | than most functions. | ||
| + | |||
| + | This function is the complementary operation of [[cofilter]] | ||
| + | |||
| + | This function is closely related to [[pattern]], | ||
| + | words in a word list that do not match a wildcard pattern. | ||
| + | |||
| + | All of the co* functions take a wildcard pattern, and two variable names. | ||
| + | The variables should contain word lists and each variable should have the | ||
| + | same number of words. | ||
| + | against the wildcard pattern, and depending on result, the corresponding | ||
| + | word in the second list is included or excluded in the return value. | ||
| + | |||
| + | The [[copattern]] function returns all those words in $< | ||
| + | in position to those words in $< | ||
| + | |||
| + | 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 wildcard < | ||
| + | if the pattern contains spaces. | ||
| + | of the wildcard pattern. | ||
| + | |||
| + | ======Practical: | ||
| + | When you have two variables, one that contains a list of control data, | ||
| + | and another that contains a list of secondary data, and you wish to | ||
| + | retrieve the secondary data, but you need to do it based on a query of | ||
| + | the control data, you might use this function. | ||
| + | be if one variable held your friends list, and another held their access | ||
| + | levels. | ||
| + | |||
| + | ======Returns: | ||
| + | The words from $< | ||
| + | that are not matched by < | ||
| + | |||
| + | ======Examples: | ||
| + | < | ||
| + | @ friends = [bob@foo.com tom@bar.com] | ||
| + | @ levels | ||
| + | $copattern(*@foo.com friends levels) | ||
| + | $copattern(*@bar.com friends levels) | ||
| + | $copattern(*@*.com friends levels) | ||
| + | $copattern(*@*.net friends levels) | ||
| + | </ | ||
copattern.txt · Last modified: 2007/03/02 02:32 by 127.0.0.1
