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

	<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>2004-07-12T20:52:42-04:00</updated>

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

		<entry>
		<author><name><![CDATA[mm]]></name></author>
		<updated>2004-07-12T20:52:42-04:00</updated>

		<published>2004-07-12T20:52:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38502#p38502</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38502#p38502"/>
		<title type="html"><![CDATA[regexp/string match badword]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38502#p38502"><![CDATA[
Thank you so much.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5145">mm</a> — Mon Jul 12, 2004 8:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2004-07-11T15:11:48-04:00</updated>

		<published>2004-07-11T15:11:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38443#p38443</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38443#p38443"/>
		<title type="html"><![CDATA[regexp/string match badword]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38443#p38443"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if {['string match -nocase "* $w *" " $text "']} {</code></pre></div>there is a couple of ' that's not supposed to be there.<div class="codebox"><p>Code: </p><pre><code>if {[string match -nocase "* $w *" " $text "]} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Sun Jul 11, 2004 3:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mm]]></name></author>
		<updated>2004-07-11T14:48:11-04:00</updated>

		<published>2004-07-11T14:48:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38442#p38442</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38442#p38442"/>
		<title type="html"><![CDATA[regexp/string match badword]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38442#p38442"><![CDATA[
Hi, when i try as "user" has suggested -&gt; how about 'string match -nocase "* $w *" " $strip "'?<br><br>foreach w $bad_words {<br>    if {['string match -nocase "* $w *" " $text "']} {<br><br>i get the error<br>Tcl error [protect:channel]: extra characters after close-quote<br><br><br>Dedan/Unknown1 can i have the working script please?<br><br><br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5145">mm</a> — Sun Jul 11, 2004 2:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Unknown1]]></name></author>
		<updated>2004-07-01T17:06:22-04:00</updated>

		<published>2004-07-01T17:06:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38120#p38120</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38120#p38120"/>
		<title type="html"><![CDATA[regexp/string match badword]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38120#p38120"><![CDATA[
Hmm, as you see I'm new to tcl.. But that looks like a perfect solution.. Trying now.. Thanks..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5050">Unknown1</a> — Thu Jul 01, 2004 5:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-07-01T17:17:02-04:00</updated>

		<published>2004-07-01T16:59:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38118#p38118</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38118#p38118"/>
		<title type="html"><![CDATA[regexp/string match badword]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38118#p38118"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>regsub -all -nocase {[^a-z]+} $line " " line</code></pre></div>EDIT: I added a "+" to make it look a bit less paced out <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Jul 01, 2004 4:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Unknown1]]></name></author>
		<updated>2004-07-01T16:28:11-04:00</updated>

		<published>2004-07-01T16:28:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38116#p38116</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38116#p38116"/>
		<title type="html"><![CDATA[regexp/string match badword]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38116#p38116"><![CDATA[
I'm having the same problem.. And I came to the same conclusing to just add a space on the front and back of the string.. But there is still a problem...<br><br>If the string has any non alpha chars in it, it will still miss the badword.<br><br>example:<br>" This is a test badword. "<br><br>It will still miss the badword because " badword. " doesn't match " badword "..<br><br>I see a way to strip all color codes out of a string.. Is there a way to strip all non alpha chars?<br><br>Or is there a better solution?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5050">Unknown1</a> — Thu Jul 01, 2004 4:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dedan]]></name></author>
		<updated>2004-03-26T08:47:33-04:00</updated>

		<published>2004-03-26T08:47:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34960#p34960</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34960#p34960"/>
		<title type="html"><![CDATA[regexp/string match badword]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34960#p34960"><![CDATA[
doh<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3472">Dedan</a> — Fri Mar 26, 2004 8:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-03-26T05:12:37-04:00</updated>

		<published>2004-03-26T05:12:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34949#p34949</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34949#p34949"/>
		<title type="html"><![CDATA[regexp/string match badword]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34949#p34949"><![CDATA[
<blockquote class="uncited"><div>If i use: <br>Code: <br><br>    foreach w $badwords { <br>      if {[string match -nocase "* $w *" "$strip"]} { <br><br> <br><br>it will not work if there is only one word typed or if there is no space after the $w</div></blockquote>...that's why I suggested the additional spaces around $strip<blockquote class="uncited"><div>how about 'string match -nocase "* $w *" "&lt;SPACE&gt;$strip&lt;SPACE&gt;"'?</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri Mar 26, 2004 5:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dedan]]></name></author>
		<updated>2004-03-26T05:08:38-04:00</updated>

		<published>2004-03-26T05:08:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34948#p34948</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34948#p34948"/>
		<title type="html"><![CDATA[regexp/string match badword]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34948#p34948"><![CDATA[
If i use: <br>Code: <br><br>    foreach w $badwords { <br>      if {[string match -nocase "* $w *" "$strip"]} { <br><br> <br><br>it will not work if there is only one word typed or if there is no space after the $w<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3472">Dedan</a> — Fri Mar 26, 2004 5:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-03-26T05:03:43-04:00</updated>

		<published>2004-03-26T05:03:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34947#p34947</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34947#p34947"/>
		<title type="html"><![CDATA[regexp/string match badword]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34947#p34947"><![CDATA[
how about 'string match -nocase "* $w *" " $strip "'?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri Mar 26, 2004 5:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dedan]]></name></author>
		<updated>2004-03-26T02:00:18-04:00</updated>

		<published>2004-03-26T02:00:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=34946#p34946</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=34946#p34946"/>
		<title type="html"><![CDATA[regexp/string match badword]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=34946#p34946"><![CDATA[
surely you will suggest i "bind' each badword to a proc,<br>but this is an all-in-one script ... it looks for<br>codes/caps/badwords and repeats.<br><br>i want to set the badwords as a list, and match them againist text.<br>i also will be using 2 different lists.<br><br>set badwords {<br>  "test"<br>  "t e s t"<br>  "*more*"<br>}<br><br><br>PROBLEM:<br><br>If i use:<div class="codebox"><p>Code: </p><pre><code>    foreach w $badwords {      if {[string match -nocase "$w" "$strip"]} {</code></pre></div>it will not work because:<br>string does not match the pattern<br>the entire string had to match the entire pattern, character for character.<br><br>If i use:<div class="codebox"><p>Code: </p><pre><code>    foreach w $badwords {      if {[string match -nocase "*$w*" "$strip"]} {</code></pre></div>it will not work because: it will kick on "testing" ... i only want it to kick on "test"<br><br><br>If i use:<div class="codebox"><p>Code: </p><pre><code>    foreach w $badwords {      if {[string match -nocase "* $w *" "$strip"]} {</code></pre></div>it will not work if there is only one word typed or if there is no space after the $w<br><br><br><br>if i split the string to a list and list search,<br>entrys like "t e s t" can not be matched.<br><br>i have tried some regexp, but it will kick on "testing" ... i only want it to kick on "test"<br><br><br>thanks for any help given<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3472">Dedan</a> — Fri Mar 26, 2004 2:00 am</p><hr />
]]></content>
	</entry>
	</feed>
