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

	<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>2008-01-08T16:08:04-04:00</updated>

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

		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2008-01-08T16:08:04-04:00</updated>

		<published>2008-01-08T16:08:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79880#p79880</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79880#p79880"/>
		<title type="html"><![CDATA[string match question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79880#p79880"><![CDATA[
Wouldnt it be easier to just use regexp?<br><div class="codebox"><p>Code: </p><pre><code>if {[regexp {"*color:blue;"&gt;&lt;b&gt;(.*?)&lt;/b&gt;"} $body fullmatch mymatch]} {            # $mymatch has the data you're looking for} else {            #putcmdlog "no match"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Tue Jan 08, 2008 4:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2008-01-08T13:47:29-04:00</updated>

		<published>2008-01-08T13:47:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79878#p79878</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79878#p79878"/>
		<title type="html"><![CDATA[string match question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79878#p79878"><![CDATA[
<em class="text-italics">break</em> exits the loop, you should add the break inside the if-statement since you already found your match in the first line. Of course, add the break after the needed statements inside the if-statement (in your case, after the regexp).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Tue Jan 08, 2008 1:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[NewzUK]]></name></author>
		<updated>2008-01-08T12:05:52-04:00</updated>

		<published>2008-01-08T12:05:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79877#p79877</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79877#p79877"/>
		<title type="html"><![CDATA[string match question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79877#p79877"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>    foreach line [split $body \n] {   if {[string match "*color:blue;\"&gt;&lt;b&gt;*" $line]} {    regexp {&lt;b&gt;(.*)&lt;/b&gt;} $line - news  } }}</code></pre></div>I tired putting a break line after the foreach, but then it does nothing  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2210">NewzUK</a> — Tue Jan 08, 2008 12:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2008-01-08T11:30:21-04:00</updated>

		<published>2008-01-08T11:30:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79876#p79876</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79876#p79876"/>
		<title type="html"><![CDATA[string match question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79876#p79876"><![CDATA[
What do you do inside that 'if'? You should probably 'break' out of the foreach loop <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=2878">user</a> — Tue Jan 08, 2008 11:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[NewzUK]]></name></author>
		<updated>2008-01-08T10:51:11-04:00</updated>

		<published>2008-01-08T10:51:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79875#p79875</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79875#p79875"/>
		<title type="html"><![CDATA[string match question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79875#p79875"><![CDATA[
well I've used exactly the same script to get other pages and it's worked, anyway, here is the part I use to get the line:<br><div class="codebox"><p>Code: </p><pre><code>    foreach line [split $body \n] {    if {[string match "*storylink*" $line]} {</code></pre></div>and instead of getting the first line 'storylink' is in, it's getting the last. I'm not doing anything else to it except filtering the bits of the line I don't need.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2210">NewzUK</a> — Tue Jan 08, 2008 10:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2008-01-08T10:40:56-04:00</updated>

		<published>2008-01-08T10:40:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79874#p79874</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79874#p79874"/>
		<title type="html"><![CDATA[Re: string match question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79874#p79874"><![CDATA[
I don't see how this is a string match problem. string match will not tell you where the match is, so the error must be in some other part of your code (obviously).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Tue Jan 08, 2008 10:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[NewzUK]]></name></author>
		<updated>2008-01-08T10:06:10-04:00</updated>

		<published>2008-01-08T10:06:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79873#p79873</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79873#p79873"/>
		<title type="html"><![CDATA[string match question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79873#p79873"><![CDATA[
Hi - I'm working on a script to retrieve news headlines from a site - I use string match to identify the line in the html that has the info I want. <br><br>Normally when I do this, it gets the first line of the match, but in this case it's getting the last line (as there are many) at the bottom of the page...is there any way around this?<br><br>Thanks in advance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2210">NewzUK</a> — Tue Jan 08, 2008 10:06 am</p><hr />
]]></content>
	</entry>
	</feed>
