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

	<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>2003-03-19T12:07:50-04:00</updated>

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

		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-03-19T12:07:50-04:00</updated>

		<published>2003-03-19T12:07:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18007#p18007</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18007#p18007"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18007#p18007"><![CDATA[
<blockquote class="uncited"><div>Solution: regexp -all -nocase -- {^(#.*)} $text match</div></blockquote>^ matches the start of a line, so for your rule to match the channel name must be the first word in the text, the * quantifier is greedy, so you'll get the complete line <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> try my previous suggestion...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Mar 19, 2003 12:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ProXy]]></name></author>
		<updated>2003-03-19T11:52:39-04:00</updated>

		<published>2003-03-19T11:52:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18006#p18006</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18006#p18006"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18006#p18006"><![CDATA[
This is a nearly Solution: regexp -all -nocase -- {^(#.*)} $text match<br><br>The last problem. If someone say "#abc abc abc", then not only "#abc" is saved to $match, but the whole string<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1729">ProXy</a> — Wed Mar 19, 2003 11:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ProXy]]></name></author>
		<updated>2003-03-19T11:30:17-04:00</updated>

		<published>2003-03-19T11:30:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18004#p18004</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18004#p18004"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18004#p18004"><![CDATA[
Sorry, use rbut your source even detects abc#abc as a channel ad...that`s not want i`m looking for.<br><br>Allowed:<br>bla#bla<br>bla##<br>bla#<br><br>NOT allowed:<br>#<br>##<br>#bla<br>#bla#<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1729">ProXy</a> — Wed Mar 19, 2003 11:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-03-19T11:24:25-04:00</updated>

		<published>2003-03-19T11:24:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18002#p18002</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18002#p18002"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18002#p18002"><![CDATA[
regexp {(?:^|[ ])(#[^, ]*)} $text chan chan<br><br>Notice the *, not +, because "#" is a valid channel name.<br><br>The first part of the rule is to make shure there's a space before the # (or that # is the first char in the text)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Mar 19, 2003 11:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TsT]]></name></author>
		<updated>2003-03-19T10:52:01-04:00</updated>

		<published>2003-03-19T10:52:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18001#p18001</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18001#p18001"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18001#p18001"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># returns channel name if found,# else return nothingproc getchannelname_ifexists {text} {    if {[regexp {(#[^, ]+)} $arg _ chan]} {        return $chan    }}</code></pre></div><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=2803">TsT</a> — Wed Mar 19, 2003 10:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ProXy]]></name></author>
		<updated>2003-03-19T08:46:12-04:00</updated>

		<published>2003-03-19T08:46:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18000#p18000</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18000#p18000"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18000#p18000"><![CDATA[
Well if i use this, also bla#bla ist detected as channel advertising... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1729">ProXy</a> — Wed Mar 19, 2003 8:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-03-19T07:47:45-04:00</updated>

		<published>2003-03-19T07:47:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17999#p17999</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17999#p17999"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17999#p17999"><![CDATA[
<blockquote class="uncited"><div>How about matching anything but space?<br><br>eg: regexp {#[^ ]*} $the_string chan</div></blockquote>even better =)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Wed Mar 19, 2003 7:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-03-19T06:00:07-04:00</updated>

		<published>2003-03-19T06:00:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17996#p17996</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17996#p17996"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17996#p17996"><![CDATA[
How about matching anything but space?<br><br>eg: regexp {#[^ ]*} $the_string chan<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Mar 19, 2003 6:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-03-19T04:58:10-04:00</updated>

		<published>2003-03-19T04:58:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17991#p17991</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17991#p17991"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17991#p17991"><![CDATA[
just a little sidenot... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> instead of using {0,} you can just use *, or + instead of {1,} ... this will do exactly the same thing<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Wed Mar 19, 2003 4:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ProXy]]></name></author>
		<updated>2003-03-18T19:36:19-04:00</updated>

		<published>2003-03-18T19:36:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17979#p17979</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17979#p17979"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17979#p17979"><![CDATA[
Well I think it`s better to catch EVERYTHINK against the # and just split the result string to get the channel. This will also work for every speacial char...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1729">ProXy</a> — Tue Mar 18, 2003 7:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-03-18T18:40:58-04:00</updated>

		<published>2003-03-18T18:40:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17977#p17977</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17977#p17977"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17977#p17977"><![CDATA[
Few test examples, by using "tclsh"<br><blockquote class="uncited"><div>proc tm {in} {<br>  regexp {((#)+([a-zA-Z0-9])+)} $in match<br>  return $match<br>}<br><br>tm "hello to #all out there"<br>#all<br><br>tm "Funny old ##world"<br>##world<br><br>tm "##"<br>can't read "match": no such variable<br><br>tm "hello ## all"<br>can't read "match": no such variable</div></blockquote>As such, it causes error when ## is on it's own<br><blockquote class="uncited"><div>proc tm {in} {<br>  regexp {((#)+([\#a-zA-Z0-9]{0,})+)} $in match<br>  return $match<br>}<br><br>tm "##"<br>##<br><br>tm "hello ## all"<br>##</div></blockquote>The regexpr works by looking for a #, followed by and uper/lower case letter or numbers, until the next non-matched char.<br><br>Because the # wasn't matched within it, it coudln't pick it up.<br><br>At the same time, it didn't allow you to check for single #'s. The {0,} means 0 or more matches.<br><br>As a # doesn't mean a spam (usualy), you can change the {0,} to {1,} requiring at leave one character after the #.<br><br>Aditionaly, you will find that you need more characters in the  name matching, as channel names can contain other charcters.<br><br>Objects to add may be -, _, !,  colour character, bold, underline, reverse, normal, ctcp, and many many more (best to see the IRC RFC).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue Mar 18, 2003 6:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ProXy]]></name></author>
		<updated>2003-03-18T16:47:06-04:00</updated>

		<published>2003-03-18T16:47:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17976#p17976</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17976#p17976"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17976#p17976"><![CDATA[
But i guess this will not match ##, right?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1729">ProXy</a> — Tue Mar 18, 2003 4:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-03-18T16:34:18-04:00</updated>

		<published>2003-03-18T16:34:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17975#p17975</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17975#p17975"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17975#p17975"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>regexp {((#)+([a-zA-Z0-9])+)} $text match</code></pre></div>$match will then contain "#blafblsfbljd" or "##afjhfef34" or whatever =)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Tue Mar 18, 2003 4:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-03-18T16:27:33-04:00</updated>

		<published>2003-03-18T16:27:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17974#p17974</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17974#p17974"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17974#p17974"><![CDATA[
foreach word [split $text] { <br>if {![string match "*#*" $word] || [string match "#" $word] || [string compare -nocase $word $chan] == 0} { continue } <br>rest of the code<br>}<br><br>This way will see if someones uses a #something and will compare the #somehting with the channel that #something was said in and if it's the same will continue, if not will do your proc. Hope this helps you..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Mar 18, 2003 4:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ProXy]]></name></author>
		<updated>2003-03-18T13:48:49-04:00</updated>

		<published>2003-03-18T13:48:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=17970#p17970</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=17970#p17970"/>
		<title type="html"><![CDATA[detect channel advertising]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=17970#p17970"><![CDATA[
Hello, I just use Nosense to protect my chan against channel advertising. Theres only a little error in nosense: It doesn`t match Channel like ## oder ###. these are valid qnet chans, so i wanted to rewrite the regexp.<br><br>I want to check if one or more char is after # and save the channel in a var called $match.<br><br>I tried to match using this source:<div class="codebox"><p>Code: </p><pre><code>[regexp -nocase {#.+} $text match]</code></pre></div>But this does not work, because my regexp doesn`t stop before the next space. If the string is "i am on #htp and you are not", $match only should have the value "#htp". Could anyone please tell me how to use regexp to match the right part of the string?<br><br>ProXy<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1729">ProXy</a> — Tue Mar 18, 2003 1:48 pm</p><hr />
]]></content>
	</entry>
	</feed>
