<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/13426" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2007-05-08T21:23:48-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/13426</id>

		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-05-08T21:23:48-04:00</updated>

		<published>2007-05-08T21:23:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72611#p72611</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72611#p72611"/>
		<title type="html"><![CDATA[Special characters in string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72611#p72611"><![CDATA[
All special characters to replace which are used in nicks and masks:<br><div class="codebox"><p>Code: </p><pre><code>set banmask [string map {\\ \\\\ [ \\\[ ] \\\] \{ \\\{ \} \\\}} $banmask]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Tue May 08, 2007 9:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-04-29T12:03:20-04:00</updated>

		<published>2007-04-29T12:03:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72351#p72351</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72351#p72351"/>
		<title type="html"><![CDATA[Special characters in string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72351#p72351"><![CDATA[
I already showed you how it's done, let me paste it again more explained:<div class="codebox"><p>Code: </p><pre><code># List of masks which you want to be bannedset banmasks { *[M]*!*@* bla!*@* lame!*[foo]*@bar.* nickwith\{!*@* nick-with_\}!*@* nickwith\\!*@*}bind join -|- * BLK:Jproc BLK:J {nick uhost hand chan} { global banmasks # U is nick!user@host set U $nick!$uhost foreach banmask $banmasks {  # here you skip the brackets [ and ]  set banmask [string map {[ \\[ ] \\]} $banmask]  # this way *[M]* will match only *[M]* and not *M*  if {[string match -nocase $banmask $U]} {   # You've found a match!   break  } }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun Apr 29, 2007 12:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dedan]]></name></author>
		<updated>2007-04-28T22:04:06-04:00</updated>

		<published>2007-04-28T22:04:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72344#p72344</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72344#p72344"/>
		<title type="html"><![CDATA[Special characters in string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72344#p72344"><![CDATA[
{[ \\[ ] \\]}   ??????<br>you mean {[ \\[ \\] ]}   ????<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3472">Dedan</a> — Sat Apr 28, 2007 10:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-04-28T21:50:12-04:00</updated>

		<published>2007-04-28T21:50:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72343#p72343</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72343#p72343"/>
		<title type="html"><![CDATA[Special characters in string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72343#p72343"><![CDATA[
So your issue was with the move? I simply moved it because user's topic is about ban masks and not [string match]. If you don't want anyone but user to answer you then don't do a public post in the forum. I didn't get your array argument though, I still believe using a list is a better choice.<br><br>I already said that only [ and ] have special meaning in [string match] so all you need is to apply that string map to the match as I've indicated in the sample code I wrote.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat Apr 28, 2007 9:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dedan]]></name></author>
		<updated>2007-04-28T22:27:05-04:00</updated>

		<published>2007-04-28T21:42:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72342#p72342</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72342#p72342"/>
		<title type="html"><![CDATA[Special characters in string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72342#p72342"><![CDATA[
1) the original post refected an aspect of the orginal topic user started<br>2) the orginal post was directed to user<br>3) it is set in an array because it does have value, 5+ values<br>4) are you suggesting i should use:<br>set banmask [string map {[ \\[ ] \\]} $banmask] <br><br>set banmask [string map {[ \\{ } \\]} $banmask] <br><br>set banmask [string map {[ \\- _ \\]} $banmask]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3472">Dedan</a> — Sat Apr 28, 2007 9:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-04-28T21:34:43-04:00</updated>

		<published>2007-04-28T21:34:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72340#p72340</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72340#p72340"/>
		<title type="html"><![CDATA[Special characters in string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72340#p72340"><![CDATA[
Fix your attitude so you would understand what I'm suggesting.<blockquote class="uncited"><div>set banmask "*[M]*!*@*"</div></blockquote>This obviously causes an error since it will try to evaluate M as a Tcl-command.<blockquote class="uncited"><div>set blacklist($banmask)</div></blockquote>This also causes an error since it has no parameter (proper syntax is: set var-name value)...<br><br>And I don't see why you're storing the masks in an array where you can simply use a list.<div class="codebox"><p>Code: </p><pre><code>set banmasks { *[M]*!*@* bla!*@* lame!*[foo]*@bar.*}bind join -|- * BLK:Jproc BLK:J {nick uhost hand chan} { global banmasks set U $nick!$uhost foreach banmask $banmasks {  # here's where my suggestion helps  set banmask [string map {[ \\[ ] \\]} $banmask]  if {[string match -nocase $banmask $U]} {   # You've found a match!   break  } }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat Apr 28, 2007 9:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dedan]]></name></author>
		<updated>2007-04-28T21:15:13-04:00</updated>

		<published>2007-04-28T21:15:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72338#p72338</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72338#p72338"/>
		<title type="html"><![CDATA[Special characters in string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72338#p72338"><![CDATA[
what are you talking about?<br><div class="codebox"><p>Code: </p><pre><code> set banmask "*[M]*!*@*" set blacklist($banmask) bind join -|- * BLK:Jproc BLK:J {N uhost H C} {  set U "$N![getchanhost $N]"  foreach E [array names blacklist] {    if {[string match -nocase $E $U]} {</code></pre></div>and you are suggesting what?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3472">Dedan</a> — Sat Apr 28, 2007 9:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-04-28T20:44:00-04:00</updated>

		<published>2007-04-28T20:44:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72337#p72337</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72337#p72337"/>
		<title type="html"><![CDATA[Special characters in string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72337#p72337"><![CDATA[
You won't face problems with {, }, -, _, or \ using [string match] (as long as you properly use string and list commands). You only need to skip [ and ], applying the following string map on the match should do it:<div class="codebox"><p>Code: </p><pre><code>set match [string map {[ \\[ ] \\]} $match]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat Apr 28, 2007 8:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dedan]]></name></author>
		<updated>2007-04-28T17:11:50-04:00</updated>

		<published>2007-04-28T17:11:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72334#p72334</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72334#p72334"/>
		<title type="html"><![CDATA[Special characters in string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72334#p72334"><![CDATA[
never the less user i am in the final stages<br>of a very nice blacklist script for large channels<br><br>i would like to be able to ban nicks with <br>special chars in them but it seems impossible.<br><br>i am currently using "string match" for compare<br><br><br>[01:50] &lt;botowner&gt; .tcl string match *[M]*!*@* *!*@*<br>[01:50] &lt;bot&gt; Tcl error: invalid command name "M"<br><br>[01:50] &lt;botowner&gt; .tcl string match *\[M\]*!*@* *M*!*@*<br>[01:50] &lt;bot&gt; Tcl: 1<br><br><br>upon blacklisting *[M]*!*@* the script banned <br>everyone that had a M in their nick<br><br>i would like to ban nicks with [,],-,_.\,{, and } in them<br><br>any suggestions?<br><br><span style="color:red">Edit: I've moved this post from the FAQ to this forum due to its irrelevance. (Sir_Fz)</span><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3472">Dedan</a> — Sat Apr 28, 2007 5:11 pm</p><hr />
]]></content>
	</entry>
	</feed>
