Originally Posted By: hixxy
Code:
if $wildtok(%rkb_at_networks,$+(*,$network,*),1,32) {
Originally Posted By: RusselB
... but I was wondering if there was a way (preferably easy) to allow for a partial match (eg: Pleasure would match Pleasurenet) and still allow for multiple networks to be passed through the single variable.


that $wildtok won't cause the token "pleasure" to match the wildcard text *Pleasurenet* in that example the way $wildtok compares.. you could try doing something like

Code:
if ($wildtok(%rkb_at_networks,$+(*,$network,*),1,32)) || ($wildtok(%rkb_at_networks,$replace($gettok($network,1,46),$chr(45),$chr(42)),1,32)) { whatever }


so you can go for more exact matches if they exist but otherwise take only the first token seperated by . so you remove the tld and replace "-" with * so it will match more common partials i.e..

network whatever.net will be changed to "*whatever*"

networks like Chat-Net.org will be changed to "chat*net" in case someone uses network name "chatnet"

I think that should match anything people actually expect to match


Edit: err.. I just realized mine wont match "pleasure" to a "pleasurenet" network name either.. also realized a || is fine instead of elseif because if the first one matches it'll go with that result everytime

Last edited by chiram; 22/05/07 04:26 AM.