<?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/1636" />

	<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>2002-05-02T15:06:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Petersen]]></name></author>
		<updated>2002-05-02T15:06:00-04:00</updated>

		<published>2002-05-02T15:06:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=6626#p6626</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=6626#p6626"/>
		<title type="html"><![CDATA[Why is it so difficult to compare/catch [ and ] in tcl ... h]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=6626#p6626"><![CDATA[
no<br><blockquote class="uncited"><div>if {[string match *\[*\]* $var]} {<br>return 1<br>} else {<br>return 0<br>}</div></blockquote> <br><br>the characters [ and ] parsed by the string command as metacharacters, thus the double escapeage<br><br>&lt;font size=-1&gt;[ This Message was edited by: Petersen on 2002-05-02 13:15 ]&lt;/font&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=60">Petersen</a> — Thu May 02, 2002 3:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-05-02T14:54:00-04:00</updated>

		<published>2002-05-02T14:54:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=6623#p6623</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=6623#p6623"/>
		<title type="html"><![CDATA[Why is it so difficult to compare/catch [ and ] in tcl ... h]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=6623#p6623"><![CDATA[
if {([string match "]" "$var"]) || ([string match "[" "$var"])} {return 1} {return 0}<br><br>in short, enclose the brackets in quotes in your string match and that should identify it as a string and not a tcl bracket.<br><br>&lt;font size=-1&gt;[ This Message was edited by: Mordred on 2002-05-02 12:57 ]&lt;/font&gt;<p>Statistics: Posted by Guest — Thu May 02, 2002 2:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-05-02T12:02:00-04:00</updated>

		<published>2002-05-02T12:02:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=6621#p6621</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=6621#p6621"/>
		<title type="html"><![CDATA[Why is it so difficult to compare/catch [ and ] in tcl ... h]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=6621#p6621"><![CDATA[
anyone know how to "catch" character [ and ] ?<br><br>I want to make a function "if there is [ and ] return 1"<br><br>tclsh<br>% set a x<br>x<br>% set b x<br>x<br>% string match $a $b<br>1<br>% set a "*[*]*"<br>*[*]*<br>% set b "[]"<br>[]<br>% string match $a $b<br>0<br>% set b "["<br>[<br>% string match $a $b<br>0<br>% <p>Statistics: Posted by Guest — Thu May 02, 2002 12:02 pm</p><hr />
]]></content>
	</entry>
	</feed>
