This is an old code segment I wrote for a friend that uses regsubex to find/replace acronyms awhile back.

alias scannreplace {
var %scnt = $1-
var %p = 1
while (%p < 10) {
%scnt = $regsubex(flol, %scnt ,lol,%loltext)
%scnt = $regsubex(flmao, %scnt ,lmao,%lmaotext)
%scnt = $regsubex(flmfao, %scnt ,lmfao,%lmfaotext)
%scnt = $regsubex(fhaha, %scnt ,haha,%hahatext)
%scnt = $regsubex(fbrb, %scnt ,brb,%brbtext)
%scnt = $regsubex(fwb, %scnt ,lwb,%wbtext)
%scnt = $regsubex(fyw, %scnt ,yw,%ywtext)
%scnt = $regsubex(fty, %scnt ," ty", %tytext)
inc %p
}
return %scnt
}

That's horribly redundant I think Ima recode it tonight and swap the globals for an ini loaded hash XD.

Not sure where just $regex alone would be used, maybe for database handling? if ( $mid($1,0,1) != / ) works for checking if an input is a command or a message better then regex would so don't know.

Never needed it before.


//echo  $regex(regtext,haha lol haha lol haha lol haha,haha)

returns 1? o.O


how about
(untested)

Code:
on *:TEXT:*:#room:{
if ($regex($1-,http://) &gt; 0) {
kick $chan $nick NO SPAMMING
}
}

Last edited by netsplit; 05/09/06 04:08 AM.