# $EPIC: pattern.txt,v 1.3 2007/05/15 01:28:58 jnelson Exp $ ======Synopsis:====== $__pattern__( ) ======Technical:====== * If the argument is omitted the empty string is returned. * This function returns a space separated word list of all of the words in that are matched by . * This is the complement to $[[filter]](), and the inverse of $[[rpattern]](). * Remember that the words in are [[what is a word|words]], so double quoted words are not honored unless you turn [[xdebug]] dword on. * The is also a [[what is a word|word]], so you should not put double quotes around it unless you have turned [[xdebug]] dword on. This is an important difference from epic4. * Double quotes around words are not lost if you have [[xdebug]] dword turned on. This is an important difference from epic4. * There is no reasonable way to support matching a that has spaces (a dword) against a word list that does not have spaces (a uword list), since by rule a uword can **never** contain a space, so it can't match. It has to be all one way or the other. ======Practical:====== This function lets you "filter" through a pattern, keeping all of the words that match the pattern and discarding all of the words that do not match the pattern. By appending * to a string and using this function, you can quickly find all words in a word list that start with a particular substring. ======Returns:====== The list of words from that are matched by . ======History:====== This function first appeared in "plus-2" (post-ircII, pre-EPIC) ======Examples:====== $pattern(*oo* foobar blah booya) returns "foobar booya" $pattern(*a* hello there bob) returns nothing $pattern(irc* $myservers()) returns all servers you are connected to that start with the string "irc".