alias find {
var %f = test.txt, %l = $lines(%f)
while (%l) {
var %x = lol|look|at|him|he|sucks
if ($regex($read(%f,n,%l),/( $+ %x $+ )/i)) {
echo -a * I've found one match for: $regml(1)
}
dec %l
}
}
Enter /find to search the matches listed in the regex against the test.txt.
I assume your intention is to find matches in test.txt against what people say in the channel. If that's the case, you can use:
Code:
on *:text:*:#: find $1-
on *:action:*:#: find $1-
on *:notice:*:#: find $1-
alias -l find {
var %f = test.txt, %l = $lines(%f)
while (%l) {
if ($regex($1-,/\b( $+ $read(%f,n,%l) $+ )\b/iS)) {
;your command here
}
dec %l
}
}