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

	<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-10-29T05:39:25-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-29T05:39:25-04:00</updated>

		<published>2002-10-29T05:39:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12556#p12556</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12556#p12556"/>
		<title type="html"><![CDATA[checking if string contains 2 the same chars]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12556#p12556"><![CDATA[
THis is because of the following code.<br><div class="codebox"><p>Code: </p><pre><code>set mp3players {" \*word\*word2\* "" \*word\*word2\* "}</code></pre></div>This produces a list, which you have used in the script, but when each element is converted into a string, the escaping is lost, and it becomes a plain old *.<br><br>To get around this, I think you can use<br><div class="codebox"><p>Code: </p><pre><code>set mp3players [list]lappend mp3players "\*word\*word2\* "lappend mp3players "\*word3\*word4\* "</code></pre></div>The method you use, creates the list manualy. This can be troublesome (as your script shows, it doesn't allways produce the correct results).<br><br>Lists are specialy formated, thus, when trying to manualy create the list, you have to get the exact formatting right. <br><br>Using my example above, though it is longer, it will produce the formatting for you (in theory).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue Oct 29, 2002 5:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stere0]]></name></author>
		<updated>2002-10-28T18:28:25-04:00</updated>

		<published>2002-10-28T18:28:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12547#p12547</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12547#p12547"/>
		<title type="html"><![CDATA[checking if string contains 2 the same chars]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12547#p12547"><![CDATA[
This doesn´t match, why? How can i use * in the search string?<br><blockquote class="uncited"><div><br>set mp3players {<br> " \*word\*word2\* "<br> " \*word\*word2\* "<br>}<br><br>bind pubm - "*" mp3<br><br>proc mp3 {nick uhost hand chan rest} {<br> global botnick kick_msg mp3players<br>   regsub -all -- {\002|\037|\026|\017|\003([0-9][0-9]?(,[0-9][0-9]?)?)?|^B|^V|^C([0-9][0-9]?(,[0-9][0-9]?)?)?|^_} $rest "" rest<br>   foreach mp3_line $mp3players {<br>    if {[regexp $mp3_line [string tolower [lindex [split $rest] 0]]]} {<br></div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4">stere0</a> — Mon Oct 28, 2002 6:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2002-10-26T21:07:07-04:00</updated>

		<published>2002-10-26T21:07:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12432#p12432</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12432#p12432"/>
		<title type="html"><![CDATA[checking if string contains 2 the same chars]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12432#p12432"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if {[regexp aa|bb|cc|dd|ee|ff|gg|hh|ii|jj|kk|ll|mm|nn|oo|pp|qq|rr|ss|tt|uu|vv|ww|xx|yy|zz $string]} { .... }</code></pre></div>I'm sure there's yet an even more simpler way... try reading the tcl manpages for re_syntax ...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Sat Oct 26, 2002 9:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-10-26T14:45:06-04:00</updated>

		<published>2002-10-26T14:45:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12418#p12418</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12418#p12418"/>
		<title type="html"><![CDATA[checking if string contains 2 the same chars]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12418#p12418"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set test "abcdeefg" set car "" set last [string index $test 0]for {set loop 1} {$loop &lt;= [strlen $test] } {incr loop} {   set car [string index $test $loop]   if { $car == last } { then ..  }   set last $car}</code></pre></div><p>Statistics: Posted by Guest — Sat Oct 26, 2002 2:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Nexus6]]></name></author>
		<updated>2002-10-26T14:16:37-04:00</updated>

		<published>2002-10-26T14:16:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12417#p12417</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12417#p12417"/>
		<title type="html"><![CDATA[checking if string contains 2 the same chars]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12417#p12417"><![CDATA[
Lo,<br><br>I'd like to check whether string contains 2 the same chars like "*aa*" "*bb*" and so on. <div class="codebox"><p>Code: </p><pre><code>if {([string match "*aa*" $string]) || ([string match "*bb*" $string])....... || ([string match"*zz*" $string])}</code></pre></div>It would work I just wonder if is there a simplier/shorter way to code it.<br><br>TIA<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1850">Nexus6</a> — Sat Oct 26, 2002 2:16 pm</p><hr />
]]></content>
	</entry>
	</feed>
