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

	<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>2008-10-16T22:56:26-04:00</updated>

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

		<entry>
		<author><name><![CDATA[TCL_no_TK]]></name></author>
		<updated>2008-10-16T22:56:10-04:00</updated>

		<published>2008-10-16T22:56:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85551#p85551</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85551#p85551"/>
		<title type="html"><![CDATA[matching '*' and '?' as literal chars [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85551#p85551"><![CDATA[
Thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8130">TCL_no_TK</a> — Thu Oct 16, 2008 10:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2008-10-15T17:06:15-04:00</updated>

		<published>2008-10-15T17:06:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85539#p85539</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85539#p85539"/>
		<title type="html"><![CDATA[matching '*' and '?' as literal chars [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85539#p85539"><![CDATA[
When you add escape characters to * and ? it means they'll be treated as characters instead of wild cards. When you use "\\* \\?" as match pattern then it will only match "* ?" and nothing else (common sense). What you're probably looking for is something like<div class="codebox"><p>Code: </p><pre><code>string match "*\\**\\?*" $string</code></pre></div>This will match a string containing '*' followed by '?' anywhere in a string ('*' and '?' don't necessary have to follow each other). Example<blockquote class="uncited"><div>% string match "*\\**\\?*" *!*@two*.many?.wild*.car?ds.fr<br>1</div></blockquote>Edit: If you want to count the number of '*' and '?' in a string then you should use [regexp] (it's not possible with [string match]). For example<div class="codebox"><p>Code: </p><pre><code>regexp -all {\?} $string ; # returns number of '?' in stringregexp -all {\*} $string ; # returns number of '*' in string</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Oct 15, 2008 5:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TCL_no_TK]]></name></author>
		<updated>2008-10-15T15:52:10-04:00</updated>

		<published>2008-10-15T15:52:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85538#p85538</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85538#p85538"/>
		<title type="html"><![CDATA[matching '*' and '?' as literal chars [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85538#p85538"><![CDATA[
Tryed it but got this:<blockquote class="uncited"><div>[08:47:57] &lt;Me&gt; .tcl string match {\\*\\? *?} *!*@two*.many?.wild*.car?ds.fr<br>[08:47:57] &lt;Bot&gt; Tcl: 0<br>[08:48:13] &lt;Me&gt; .tcl string match "\\*\\? *?" "*!*@two*.many?.wild*.car?ds.fr"<br>[08:48:13] &lt;Bot&gt; Tcl: 0<br>[08:48:27] &lt;Me&gt; .tcl regexp -all -- "\\*\\? *?" "*!*@two*.many?.wild*.car?ds.fr"<br>[08:48:27] &lt;Bot&gt; Tcl: 0<br>[08:48:37] &lt;Me&gt; .tcl regexp -all -- {(\\*\\?|*?)} "*!*@two*.many?.wild*.car?ds.fr"<br>[08:48:37] &lt;Bot&gt; Tcl error: couldn't compile regular expression pattern: quantifier operand invalid<br>[08:48:56] &lt;Me&gt; .tcl string match "\\*\\? *?" "*"<br>[08:48:56] &lt;Bot&gt; Tcl: 0<br>[08:48:58] &lt;Me&gt; .tcl string match "\\*\\? *?" "*?"<br>[08:48:58] &lt;Bot&gt; Tcl: 0<br>[08:48:59] &lt;Me&gt; .tcl string match "\\*\\? *?" "* ?"<br>[08:48:59] &lt;Bot&gt; Tcl: 0<br>[08:49:02] &lt;Me&gt; .tcl string match "\\*\\? *?" "?"<br>[08:49:02] &lt;Bot&gt; Tcl: 0<br>[08:49:18] &lt;Me&gt; .tcl regexp -all -- {(\\*|\\?)} "*!*@two*.many?.wild*.car?ds.fr"<br>[08:49:18] &lt;Bot&gt; Tcl: 30<br>[08:49:27] &lt;Me&gt; .tcl regexp -all -- {(\\*|\\?)} "*!*@*.fr"<br>[08:49:27] &lt;Bot&gt; Tcl: 8</div></blockquote> Played around a bit and tryed MC_8's filter from more tools, which dose the same thing you gave me. However, its not returning the number of matches <blockquote class="uncited"><div>[09:55:04] &lt;Me&gt; .tcl set wd_fil1 [filter -regexp "?"]<br>[09:55:04] &lt;bot&gt; Tcl: \?<br>[09:55:08] &lt;Me&gt; .tcl set wd_fil2 [filter -regexp "*"]<br>[09:55:08] &lt;bot&gt; Tcl: \*<br>[09:55:26] &lt;Me&gt; .tcl regexp -all -- {[$wd_fil2]} "*!*@*.fr"<br>[09:55:26] &lt;bot&gt; Tcl: 1<br>[09:56:39] &lt;Me&gt; .tcl regexp -all -- {([$wd_fil1]|[$wd_fil2])} "*!*@*.fr ?"<br>[09:56:39] &lt;bot&gt; Tcl: 1<br>[09:56:41] &lt;Me&gt; .tcl regexp -all -- {([$wd_fil1]|[$wd_fil2])} "*!*@*.fr ? *"<br>[09:56:41] &lt;bot&gt; Tcl: 1</div></blockquote> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_neutral.gif" width="15" height="15" alt=":|" title="Neutral"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8130">TCL_no_TK</a> — Wed Oct 15, 2008 3:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2008-10-15T05:04:55-04:00</updated>

		<published>2008-10-15T05:04:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85534#p85534</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85534#p85534"/>
		<title type="html"><![CDATA[matching '*' and '?' as literal chars [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85534#p85534"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>string match \\*\\? *?</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Oct 15, 2008 5:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TCL_no_TK]]></name></author>
		<updated>2008-10-16T22:56:26-04:00</updated>

		<published>2008-10-14T23:28:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85531#p85531</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85531#p85531"/>
		<title type="html"><![CDATA[matching '*' and '?' as literal chars [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85531#p85531"><![CDATA[
I've tryed using string match, but it seems to allow 'anything' as '*' (as expected). Anyone know of a way to do this, please? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8130">TCL_no_TK</a> — Tue Oct 14, 2008 11:28 pm</p><hr />
]]></content>
	</entry>
	</feed>
