This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Hostmask comparison in tcl

Old posts that have not been replied to for several years.
Locked
b
bisbis

Hostmask comparison in tcl

Post by bisbis »

Hello, im making a small script in tcl, and one part of it needs hostmask comparsion, any ideas how to do this?
Example:
lets assume user comes in irc with host ident@some.cool.vhost.com
Then he messages the bot with some trigger. the bot grabs his host ident@some.cool.vhost.com and checks if it matches hostmask lets say
*@*.vhost.com (this is stored in some variable). If it matches then the script will continue.

Thanks
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: Hostmask comparison in tcl

Post by user »

That depends on what kind of matching you want. You can use 'string match' to do tcl's kind of glob matching. But if you want matching like the irc server does it you'll need something tailor made for your ircd. (eg: if you were to follow rfc1459, you'd have to do case-insensitive matching based on the upper/lower case chars defined in that spec. (some weird additional upper-/lower-case letters))
Have you ever read "The Manual"?
Locked