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

	<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>2007-05-03T20:58:31-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-05-03T20:54:00-04:00</updated>

		<published>2007-05-03T20:54:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72503#p72503</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72503#p72503"/>
		<title type="html"><![CDATA[RegExp help please [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72503#p72503"><![CDATA[
This is a much faster method to grep the information:<div class="codebox"><p>Code: </p><pre><code>proc blo {} { set url "http://ns.wireplay.co.uk/hlstats.php?mode=playerinfo&amp;player=55" set token [::http::geturl $url] set content [split [::http::data $token] \n] ::http::cleanup $token if {[set i [lsearch -glob $content {*Kills per Death:*}]]!=-1} {  regexp {\d+\.\d+} [lindex $content [incr i]] value  puts $value }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu May 03, 2007 8:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Wannabe]]></name></author>
		<updated>2007-05-03T20:10:53-04:00</updated>

		<published>2007-05-03T20:10:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72499#p72499</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72499#p72499"/>
		<title type="html"><![CDATA[RegExp help please [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72499#p72499"><![CDATA[
Yep, sorry about that, i accedently deleted a character when removing some trash code, and it make it check the wrong html var, hence no result. its all fixed and working now, thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7360">Wannabe</a> — Thu May 03, 2007 8:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-05-03T20:58:31-04:00</updated>

		<published>2007-05-03T18:36:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72496#p72496</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72496#p72496"/>
		<title type="html"><![CDATA[RegExp help please [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72496#p72496"><![CDATA[
Worked fine for me; tested it on tclsh<div class="codebox"><p>Code: </p><pre><code>proc bla {} { set url "http://ns.wireplay.co.uk/hlstats.php?mode=playerinfo&amp;player=55" set token [::http::geturl $url] set content [::http::data $token] ::http::cleanup $token set notFound 1 foreach line [split $content \n] {  if {$notFound &amp;&amp; [regexp {Kills\sper\sDeath:} $line]} {   set notFound 0  } elseif {!$notFound} {   regexp {\d+\.\d+} $line value   puts $value   break  } }}</code></pre></div><blockquote class="uncited"><div>% package require http<br>2.5.2<br>% bla<br><strong class="text-strong">0.6649</strong></div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu May 03, 2007 6:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Wannabe]]></name></author>
		<updated>2007-05-03T15:49:52-04:00</updated>

		<published>2007-05-03T15:49:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72488#p72488</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72488#p72488"/>
		<title type="html"><![CDATA[RegExp help please [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72488#p72488"><![CDATA[
ive attempted to do what you suggested, however it never seems to find the Kill per Deaths: <br><br>Im wondering if ive split the file wrong, ive written $::html to a text document, and it comes out exactly as it is in the source. so im not sure why it wouldnt work my code is :<br><div class="codebox"><p>Code: </p><pre><code>set notFound 1set lines [split $::html \n]        foreach line $lines {              if {$notFound &amp;&amp; [regexp {Kills\sper\sDeath:} $line]} {                  set notFound 0              } elseif {!$notFound} {                  putquick "PRIVMSG $chan : Line $line found"                  regexp {\d+\.\d+} $line value                  putquick "PRIVMSG $chan : Value is $value"                  break             }       }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7360">Wannabe</a> — Thu May 03, 2007 3:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-05-03T15:30:28-04:00</updated>

		<published>2007-05-03T15:30:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72487#p72487</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72487#p72487"/>
		<title type="html"><![CDATA[RegExp help please [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72487#p72487"><![CDATA[
If you provided code, it would've been easier. The concept is easy, this should explain it:<div class="codebox"><p>Code: </p><pre><code># variable $lines is a list containing the html sourceset notFound 1foreach line $lines { if {$notFound &amp;&amp; [regexp {Kills\sper\sDeath:} $line]} {  set notFound 0 } elseif {!$notFound} {  regexp {\d+\.\d+} $line value  break }}# $value contains the number.</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu May 03, 2007 3:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Wannabe]]></name></author>
		<updated>2007-05-03T15:24:53-04:00</updated>

		<published>2007-05-03T15:24:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72486#p72486</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72486#p72486"/>
		<title type="html"><![CDATA[RegExp help please [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72486#p72486"><![CDATA[
I think i explained badly, the regexp works on the entire source of the website, not just the two lines i posted, thats the reason i wanted to get the words Kills per Death: so that i was sure it was the right data.<br><br>the problem i have is the two seperate lines i dont know how to deal with. but thanks for explaining that regexp. it actually makes sence to me now <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7360">Wannabe</a> — Thu May 03, 2007 3:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-05-03T15:13:50-04:00</updated>

		<published>2007-05-03T15:13:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72485#p72485</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72485#p72485"/>
		<title type="html"><![CDATA[RegExp help please [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72485#p72485"><![CDATA[
Well \d matches any digit, \. matches a period '.' and + (or {1,}) means 1 or more. An alternative regexp you can try is:<div class="codebox"><p>Code: </p><pre><code>regexp {&lt;.+&gt;&lt;.+&gt;(.+)&lt;.+&gt;&lt;.+&gt;} {&lt;td width="55%"&gt;&lt;font face="Verdana, Arial, sans-serif" size=2 class="fontNormal"&gt;0.6193&lt;/font&gt;&lt;/td&gt;} grbg value</code></pre></div>$value should contain 0.6193.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu May 03, 2007 3:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Wannabe]]></name></author>
		<updated>2007-05-03T15:07:23-04:00</updated>

		<published>2007-05-03T15:07:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72484#p72484</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72484#p72484"/>
		<title type="html"><![CDATA[RegExp help please [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72484#p72484"><![CDATA[
That gives me a result of 4.01, which im not sure where its getting it from but its not correct. <br><br>The entire source that the regexp needs to search through is the source of this page : <a href="http://ns.wireplay.co.uk/hlstats.php?mode=playerinfo&amp;player=55" class="postlink">http://ns.wireplay.co.uk/hlstats.php?mo ... &amp;player=55</a><br><br>if thats any help, i really dont understand that regexp you gave me atall. i stuggle to get my head around it<br><br><br>EDIT :<br>Ok i found that it match the 4.01 in this line<br><br>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<a href="http://www.w3.org/TR/html4/loose.dtd" class="postlink">http://www.w3.org/TR/html4/loose.dtd</a>"&gt;<br><br>again i dont really have a clue how the regexp works, or id try fixing it myself<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7360">Wannabe</a> — Thu May 03, 2007 3:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-05-03T15:07:58-04:00</updated>

		<published>2007-05-03T14:59:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72483#p72483</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72483#p72483"/>
		<title type="html"><![CDATA[RegExp help please [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72483#p72483"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>regexp {\d+\.\d+} {&lt;td width="55%"&gt;&lt;font face="Verdana, Arial, sans-serif" size=2 class="fontNormal"&gt;0.6193&lt;/font&gt;&lt;/td&gt;} value</code></pre></div>this will store 0.6193 in value.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu May 03, 2007 2:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Wannabe]]></name></author>
		<updated>2007-05-03T20:11:36-04:00</updated>

		<published>2007-05-03T14:48:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72482#p72482</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72482#p72482"/>
		<title type="html"><![CDATA[RegExp help please [SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72482#p72482"><![CDATA[
Hey, im still learning regular expressions, and im pretty much stumped on this one, several people have tried to help me already and its just not right yet, im using a http package to read a website, and then parse for a specific piece of info on that website, the information im after is stored in a table.<br><br>The two lines that im looking at are :<br><br>&lt;td width="45%"&gt;&lt;font face="Verdana, Arial, sans-serif" size=2 class="fontNormal"&gt;Kills per Death:&lt;/font&gt;&lt;/td&gt;<br>&lt;td width="55%"&gt;&lt;font face="Verdana, Arial, sans-serif" size=2 class="fontNormal"&gt;0.6193&lt;/font&gt;&lt;/td&gt;<br><br>what i need to do, is check that the line before has Kills per Death, and then pull the value from the next line which in this case is 0.6193. there are several sections of the table that are identical appart from the text Kills per Death: hence why i need to check both lines.<br><br>i have tried many diffrent regexp to get this working, and all return nothing.<br><br>Any help and i would be very greatful.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7360">Wannabe</a> — Thu May 03, 2007 2:48 pm</p><hr />
]]></content>
	</entry>
	</feed>
