Table of Contents

# $EPIC: rmatch.txt,v 1.5 2006/08/29 18:22:56 sthalik Exp $

Synopsis:

$rmatch(<word> <pattern list>)

Technical:

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() 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. Also, since ircII does not include the $findw() function, 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   no matches found
>0   index to "best" pattern in list -- counting from one!

Examples:

$rmatch(one o* t* f*)       returns 1
$rmatch(one z* t* f*)       returns 0
$rmatch(one o* on* t* f*)   returns 2

History:

This function first appeared in ircII.