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

	<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-10-24T16:41:39-04:00</updated>

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

		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-10-24T16:41:39-04:00</updated>

		<published>2004-10-24T16:41:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42194#p42194</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42194#p42194"/>
		<title type="html"><![CDATA[String matching (using string match)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42194#p42194"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc ishost {host} {  foreach {a b} [split [reverse_string $host] \x2E] break  if {[regexp -all {[a-zA-Z]} $a] &amp;&amp; [regexp -all {[a-zA-Z0-9]} $b]} {    if {![string match -nocase {} $a] &amp;&amp; ![string match -nocase {} $b]} {      return 1    } else {      return 0    }  } else {    return 0  }}</code></pre></div>Ah just what I need...<br>Thanks for the help both of you Ofloo and gb!<br>(I'll look into alltools.tcl as well)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sun Oct 24, 2004 4:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2004-10-24T13:47:59-04:00</updated>

		<published>2004-10-24T13:47:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42179#p42179</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42179#p42179"/>
		<title type="html"><![CDATA[String matching (using string match)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42179#p42179"><![CDATA[
or you can use the testip proc that comes with alltools.tcl<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Sun Oct 24, 2004 1:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-10-24T13:48:54-04:00</updated>

		<published>2004-10-24T13:45:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42178#p42178</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42178#p42178"/>
		<title type="html"><![CDATA[String matching (using string match)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42178#p42178"><![CDATA[
might seen crappy bit it works efficiently <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><div class="codebox"><p>Code: </p><pre><code>proc isipaddr {ipaddr} {  if {[string match -nocase {} $ipaddr]} {    return 0  }  foreach x [split $ipaddr \x2E] {    if {![regexp ^\[0-9\]+$ $x]} {      return 0    } elseif {$x &gt; 255} {      return 0    }    if {[info exists i]} {      incr i    } else {      set i 1    }  }  if {$i != 4} {    return 0  } else {    return 1  }}</code></pre></div>there is an ishost in there to if u like .. <br><br><a href="http://cvs.ofloo.net/ip-to-country/ip-to-country.tcl?rev=1.5.2.2&amp;content-type=text/vnd.viewcvs-markup" class="postlink">http://cvs.ofloo.net/ip-to-country/ip-t ... cvs-markup</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Sun Oct 24, 2004 1:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-10-24T12:07:33-04:00</updated>

		<published>2004-10-24T12:07:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42167#p42167</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42167#p42167"/>
		<title type="html"><![CDATA[String matching (using string match)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42167#p42167"><![CDATA[
Hehe, yeah thanks I know but that wasn't much of help either. REGEXP for some matching is easy and for complexity its like a way too long method of TRIAL and ERROR.<br><br>Plus its slow so I wanted to use string match over here.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sun Oct 24, 2004 12:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2004-10-24T11:54:23-04:00</updated>

		<published>2004-10-24T11:54:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42164#p42164</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42164#p42164"/>
		<title type="html"><![CDATA[Re: String matching (using string match)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42164#p42164"><![CDATA[
<blockquote class="uncited"><div>(P.S: I am terrible with REGEXP, so don't say implement it with that!)</div></blockquote>for what you want to do, you <strong class="text-strong">have to</strong> learn &amp; use regexps effectively<br><br>even if you manage to come up with a [string match] solution, it would be uglier and heavier than a regexp one (for your specific need; I'm not generalizing)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sun Oct 24, 2004 11:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-10-24T11:01:35-04:00</updated>

		<published>2004-10-24T11:01:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42157#p42157</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42157#p42157"/>
		<title type="html"><![CDATA[String matching (using string match)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42157#p42157"><![CDATA[
Hi,<br><br>[#1] I have a channel where I want to match bans containing totally ?????? with the !, @ and wildcards (*).<br><br>Bans for example like:<br><br>*!*????????*@*<br>???????*!*@*<br>*!*@*???????*<br><br>If I put ?????? into string match it would match against any single characters. How can I make it match the question mark sign?<br><br>Would it be: *!*\?\?\?\?\?\?\?\?*@*<br>By adding an extra slash infront of each question mark?<br><br>[#2] Also I want to know the best way to match numerical format ips and their reverses.<br><br>##EXAMPLE##<br>IP: 202.125.84.12<br>Resolved: host-123-745.cable.interpacket.net<br><br>How can I check to see if a ban is made only in the D, B and C (D.B.C.*) range format of the numerical ip and not resolved ip.<br><br>Like the ranges are in:<br>202.125.84.12<br>D.C.B.A<br><br>{([string match -nocase "*\[0-9\].*\[0-9\].*\[0-9\].*" [lindex [split $uhost "@"] 1]])}<br><br>And how can I differentiate between a numerical and a resolved one? Matching alphabets in the resolved in? And only numbers in the numerical one?<br><br>The thing is the numerical A, B, C, D ranges can contain sometimes 1, 2 or 3 numericals. So how to match all those combinations:<br><br>\[0-9\] or  \[0-9\]\[0-9\] or \[0-9\]\[0-9\]\[0-9\]<br><br>The same goes for resolved IP's. When and where to match alphabets? Maybe split and match the last one (The domain .com, .net, .org, .ca, .us etc). But then again we wouldn't be able to differentiate from vhosts. We would need to match numbers and characters both in resolved addresses.<br><br>If anyone can guide me to implement this simple logic would be a thumbs up for them! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>(P.S: I am terrible with REGEXP, so don't say implement it with that!)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sun Oct 24, 2004 11:01 am</p><hr />
]]></content>
	</entry>
	</feed>
