# $EPIC: beforew.txt,v 1.4 2007/03/02 02:32:04 jnelson Exp $
$beforew(<word> <pattern list>)
This function lets you get the part of <pattern list> that occurs BEFORE the pattern that is the “best match” for <word>. You can of course use this function with a list of literal words.
The portion of <pattern list> before the pattern that is the “best match” of <word>. A word is always “best matched” by itself; see the help file on pattern matching for more detail.
$beforew(foobar one two foobar my shoe) returns "one two" $beforew(booya one two foobar my shoe) returns "" (empty string) $beforew(foobar o* t* f* m* s*) returns "o* t*" $beforew(booya o* t* f* m* s*) returns "" (empty string) $beforew(foobar f* fo* foobar foo* foob*) returns "f* fo*"
This function first appeared in “plus 2” (post-ircII, pre-EPIC)