$str.grep
Performs a search in an array of strings via regular expression matching
Usage
<array> $str.grep(<match:string>,<strings:array>[,<flags:string>,<offset:integer>])
Description
Returns an array with the elements of <strings> which match the string <match>. <flags> can be any combination of the characters s, w and r.
If the flag w is specified then <match> is assumed to be a wildcard regular expression (with * and ? wildcards). If the flag r is specified then <match> is assumed to be a standard regular expression. If none of w and r is specified then <match> is treated as a simple string to be searched in each element of the <strings> array. r takes precedence over w. If the flag s is specified the matches are case sensitive.
If the offset is specified attempts to find a match in from position offset in every array's item.
If offset is -1, the search starts at the last character; if -2, at the next to last character; etc.
Note that since almost any other variable type can be automatically cast to an array, you can also use this function on scalars or hashes.
Examples

# Find all the nicknames starting with the letter A or a
echo $str.grep("^a",$chan.users,"r")
# Find the current CPU speed (on UNIX like machines only)
echo $str.grep("MHz",$str.split($lf,$file.read("/proc/cpuinfo")))
# simply check if the specified string matches a regular expression
# (this in fact is a little tricky, but you will probably not notice it :D)
if($str.grep("[st]+","test string","r"))echo "Yeah, it matches!"
See also
$array

Index, Functions