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

	<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>2005-04-20T20:22:47-04:00</updated>

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

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-04-20T20:22:47-04:00</updated>

		<published>2005-04-20T20:22:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48373#p48373</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48373#p48373"/>
		<title type="html"><![CDATA[Regular expression matching hostname ips and vhosts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48373#p48373"><![CDATA[
if you want to check exact you should consider storing the ip into 4 vars and check if 1 and 4 are between 0 and 255 (exclusive) and 2 and 3 between 0 and 255 (inclusive). Afaik the valid IPv4 range was 1.0.0.1 to 254.255.255.254.<br>I believe a few &lt; and &gt; checks on integer would be faster anyway than any extrem long regexp <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=2382">De Kus</a> — Wed Apr 20, 2005 8:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-04-20T16:10:07-04:00</updated>

		<published>2005-04-20T16:10:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48368#p48368</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48368#p48368"/>
		<title type="html"><![CDATA[Regular expression matching hostname ips and vhosts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48368#p48368"><![CDATA[
Thanks gb your a life saver. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>I tried different combinations of these patterns, but seems as if regexp (in one pattern) can't handle situtations like this, or even if it can, I am unable to do it, heh.  <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=4875">awyeah</a> — Wed Apr 20, 2005 4:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-04-20T15:52:54-04:00</updated>

		<published>2005-04-20T15:52:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48367#p48367</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48367#p48367"/>
		<title type="html"><![CDATA[Regular expression matching hostname ips and vhosts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48367#p48367"><![CDATA[
take a look at the testip proc in alltools.tcl<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Wed Apr 20, 2005 3:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-04-20T15:46:43-04:00</updated>

		<published>2005-04-20T15:46:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48366#p48366</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48366#p48366"/>
		<title type="html"><![CDATA[Regular expression matching hostname ips and vhosts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48366#p48366"><![CDATA[
These are a bit complex, I found these for the 0.0.0.0 - 255.255.255.255<br>range err, but they don't seem to work, if I put a 256 in there it still gives me<br>'1' as the output in partyline, weird.<br><div class="codebox"><p>Code: </p><pre><code>(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)</code></pre></div>Any ideas guys?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Apr 20, 2005 3:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-04-20T09:51:01-04:00</updated>

		<published>2005-04-20T09:51:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48343#p48343</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48343#p48343"/>
		<title type="html"><![CDATA[Regular expression matching hostname ips and vhosts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48343#p48343"><![CDATA[
<blockquote class="uncited"><div>string match {[`_-^/{}]} $text<br><br>detects all these characters within the [ ]'s but if we put a [ or ] within them, it causes problems. I tried to escape them with a single \ or double ot triple backslash even but it doesn't work? How can this be achieved? if we want to detect [ and ] with string match.</div></blockquote>the only thing i could succuessfully use in partyline was:<br>{[\133-\133\135-\135]}<br>without ranges it still gives the "you suck" return <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.<br><blockquote class="uncited"><div>[14:46:11] tcl: evaluate (.tcl): string match {[\[\]]} "\["<br>Tcl: 0<br>[14:47:55] tcl: evaluate (.tcl): string match {[.[].]} "\["<br>Tcl: 0<br>[14:49:20] tcl: evaluate (.tcl): string match {[\133\135]} {[}<br>Tcl: 0<br>[14:49:29] tcl: evaluate (.tcl): string match {[\133-\135]} {[}<br>Tcl: 1<br>[14:49:54] tcl: evaluate (.tcl): string match {[\133-\133\135-\135]} {[}<br>Tcl: 1</div></blockquote>strange thing, huh?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Wed Apr 20, 2005 9:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-04-20T09:36:35-04:00</updated>

		<published>2005-04-20T09:36:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48342#p48342</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48342#p48342"/>
		<title type="html"><![CDATA[Regular expression matching hostname ips and vhosts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48342#p48342"><![CDATA[
I had found another complex regexp function I will paste it later, I was unable to understand all of it detects from 0.0.0.0 to 255.255.255.255.<br><br>Also I needed to ask:<br><br>string match {[`_-^/{}]} $text<br><br>detects all these characters within the [ ]'s but if we put a [ or ] within them, it causes problems. I tried to escape them with a single \ or double ot triple backslash even but it doesn't work? How can this be achieved? if we want to detect [ and ] with string match.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Apr 20, 2005 9:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-04-20T09:03:46-04:00</updated>

		<published>2005-04-20T09:03:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48341#p48341</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48341#p48341"/>
		<title type="html"><![CDATA[Regular expression matching hostname ips and vhosts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48341#p48341"><![CDATA[
mine was just intented to be a replace for your {([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})+$} one ^-^. yours matchs up to 999, mine matchs up to 299, thats just the big deal <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.<br><br>that will consume some time.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Wed Apr 20, 2005 9:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-04-20T02:08:19-04:00</updated>

		<published>2005-04-20T02:08:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48333#p48333</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48333#p48333"/>
		<title type="html"><![CDATA[Regular expression matching hostname ips and vhosts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48333#p48333"><![CDATA[
Sorry, for my regexp above, I pasted the wrong one. Anyway thanks De_Kus I will give your piece of code a try.<br><br>I came up with these, by looking at common ips throughout irc, but we would have to OR each of these, plus these aren't all the common ones there are more. Well yours looks smaller so I'll give it a go! <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>{([a-z][0-9]{1,}).([0-9]{2,}).([0-9]{2,}).([0-9]{1,}).([a-z][0-9]{1,}).([a-z][0-9]{1,}).([a-z][0-9]{1,}).([a-z]{2,3})+$}{([a-z][0-9]{2,}).([a-z][0-9]{2,}).([0-9]{2,}).([0-9]{2,}).([0-9]{2,}).([a-z][0-9]{1,}).([a-z]{2,3})+$}{([a-z][0-9]{3,}).([a-z]{1,}).([a-z]{1,}).([a-z]]{1,}).([a-z]]{1,}).([a-z]]{2,3})+$}{([a-z][0-9]{3,}).([a-z]]{1,}).([a-z]]{1,}).([a-z]]{1,}).([a-z]]{2,3})+$}{([0-9]{2,}).([a-z][0-9]{3,}).([a-z]{1,}).([a-z]{1,}).([a-z]{2,3})+$}{([a-z][0-9]{3,}).([a-z]{1,}).([a-z]{1,}).([a-z]{1,}).([a-z]{2,3})+$}{([a-z][0-9]{3,}).([a-z]{1,}).([a-z]]{1,}).([a-z]]{2,3})+$}{([a-z][0-9]{3,}).([a-z]{1,}).([a-z]{1,}).([a-z]{2,3})+$}{([0-9]{2,}).([a-z][0-9]{3,}).([a-z]{1,}).([a-z]{2,3})+$}{([a-z][0-9]{3,}).([a-z]]{1,}).([a-z]]{2,3})+$}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Apr 20, 2005 2:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-04-19T19:39:00-04:00</updated>

		<published>2005-04-19T19:39:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48324#p48324</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48324#p48324"/>
		<title type="html"><![CDATA[Re: Regular expression matching hostname ips and vhosts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48324#p48324"><![CDATA[
<blockquote class="uncited"><div>I use this to match 0.0.0.0 - 255.255.255.255<br><div class="codebox"><p>Code: </p><pre><code>regexp {([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})+$} [lindex [split $uhost @] 1]]</code></pre></div>What would be the best way to match hostname ip's which aren't in their numerical format for instance: 376.bkj71.jaring.my or toronto-HSE-ppp3968878.sympatico.ca (so as to not differentiate them with vhosts)<br><br>I have come up with the logic? is this okay?? or can there be a better one<br><div class="codebox"><p>Code: </p><pre><code>regexp {([a-z][0-9]{1,}).([a-z][0-9]{1,}).([a-z][0-9]{1,}).([a-z][0-9]{1,})+$} [lindex [split $uhost @] 1]]} {</code></pre></div>Plus some as you see isp ips have 3 dots, 4 dots, some 5 dots (.'s) so how can we match those especially for these hostname ips?<br><br>And what about matching vhosts then? should only use [a-z] but how can we match vhosts they have many dots between words, some might have 1 if it is a domain or some more than 10 also. There are also numbers [0-9] present in vhosts?</div></blockquote>I don't believe you can find any IPs within an vhost without resolving it.<br>For ISP rdns hostnames, there might be a way to find most of them, but probably you have to do some |, because the format is so diffrent. Not too mention that some ISPs revers the IP order! So you will likely have to check against some known ISPs to filter it properly.<br><br>PS: Ah valid IP would rather match against: (stilll not error proof, but it will be rather complex to sort out everything ^^)<br> {([0-2]?[0-9]{1,2}).([0-2]?[0-9]{1,}).([0-2]?[0-9]{1,2}).([0-2]?[0-9]{1,2})+$}<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Tue Apr 19, 2005 7:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-04-19T16:21:52-04:00</updated>

		<published>2005-04-19T16:21:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48318#p48318</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48318#p48318"/>
		<title type="html"><![CDATA[Regular expression matching hostname ips and vhosts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48318#p48318"><![CDATA[
I use this to match 0.0.0.0 - 255.255.255.255<br><div class="codebox"><p>Code: </p><pre><code>regexp {([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})+$} [lindex [split $uhost @] 1]]</code></pre></div>What would be the best way to match hostname ip's which aren't in their numerical format for instance: 376.bkj71.jaring.my or toronto-HSE-ppp3968878.sympatico.ca (so as to not differentiate them with vhosts)<br><br>I have come up with the logic? is this okay?? or can there be a better one<br><div class="codebox"><p>Code: </p><pre><code>regexp {([a-z][0-9]{1,}).([a-z][0-9]{1,}).([a-z][0-9]{1,}).([a-z][0-9]{1,})+$} [lindex [split $uhost @] 1]]} {</code></pre></div>Plus some as you see isp ips have 3 dots, 4 dots, some 5 dots (.'s) so how can we match those especially for these hostname ips?<br><br>And what about matching vhosts then? should only use [a-z] but how can we match vhosts they have many dots between words, some might have 1 if it is a domain or some more than 10 also. There are also numbers [0-9] present in vhosts?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Tue Apr 19, 2005 4:21 pm</p><hr />
]]></content>
	</entry>
	</feed>
