Yep sorry I wrote that very quickly, it was all good except for a missing ) on the $regsubex and you need to actually add (*UTF8) to each pattern as well, here is something that I tested:
on *:text:*:#:{
if ($hfind(antibadword,$strip($1-),1,R).data) {
ban -k $chan $nick 2 antibadword ( base word: $v1 )
}
}
;/addbadword refword expression
;example /addbadword test test
alias addbadword hadd -m antibadword $1 (*UTF8) $+ $regsubex($2-,/(*UTF8)(.)/g,$iif($isalias(regvar_\1),$($+($,regvar_\1),2),\1))
alias regvar_E return [eéèêEÉÊ]
Just type /addbadword test test.
Now here is where regex becomes even more useful, you can use "/addbadword weed \b(weed|smoking pot)\b" and the \b means word boundaries, so it will only match if the full word is "weed" or if the two words "smoking pot" are said in a sentence, of course it also triggers for wééd, etc.