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

	<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-04T13:55:01-04:00</updated>

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

		<entry>
		<author><name><![CDATA[kenneal]]></name></author>
		<updated>2007-05-04T13:42:40-04:00</updated>

		<published>2007-05-04T13:42:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72533#p72533</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72533#p72533"/>
		<title type="html"><![CDATA[Retrieving text from messy strings, rgding -regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72533#p72533"><![CDATA[
Thx!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8781">kenneal</a> — Fri May 04, 2007 1:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kenneal]]></name></author>
		<updated>2007-05-04T13:55:01-04:00</updated>

		<published>2007-05-04T13:30:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72530#p72530</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72530#p72530"/>
		<title type="html"><![CDATA[Retrieving text from messy strings, rgding -regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72530#p72530"><![CDATA[
im testing it and everything seems good, thanks a lot!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8781">kenneal</a> — Fri May 04, 2007 1:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2007-05-04T13:18:13-04:00</updated>

		<published>2007-05-04T13:18:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72528#p72528</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72528#p72528"/>
		<title type="html"><![CDATA[Retrieving text from messy strings, rgding -regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72528#p72528"><![CDATA[
You still get the entire match first (like you did without -inline), so add another variable in the loop to weed it out. Like this: <div class="codebox"><p>Code: </p><pre><code>foreach {garbage jpg} [regexp -all -inline {='(http[^']+)'} $data] {puthelp "PRIVMSG #chan :$jpg"}</code></pre></div>If you want to capture those relative urls starting with "www" too, replace "http" in the above rule with "(?:www|http)"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri May 04, 2007 1:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kenneal]]></name></author>
		<updated>2007-05-04T12:33:29-04:00</updated>

		<published>2007-05-04T12:33:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72524#p72524</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72524#p72524"/>
		<title type="html"><![CDATA[Retrieving text from messy strings, rgding -regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72524#p72524"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if [string match *.jpg* $line] {         foreach jpg [regexp -all -inline {&lt;.*?'(http://.*?\.jpg).*?&gt;} $line] {                   puthelp "PRIVMSG #jtest :$jpg"        }}</code></pre></div>It returns me oddly the before and after regexped results.<br><br>[00:29:06] &lt;@PALL&gt; &lt;br&gt;&lt;br&gt;&lt;img src='<a href="http://hotimg2.fotki.com/b/222_88/97_98/25000.jpg" class="postlink">http://hotimg2.fotki.com/b/222_88/97_98/25000.jpg</a> ' border=0 http://www2.lookpipe.com/get.php?filepath=http://hotimg2.fotki.com/b/222_88/97_98/25000.jpg" class="postlink">http://www2.lookpipe.com/get.php?filepa ... /25000.jpg</a> ');" onload='if(this.width&gt;<br><br>[00:29:08] &lt;@PALL&gt; <a href="http://hotimg2.fotki.com/b/222_88/97_98/25000.jpg" class="postlink">http://hotimg2.fotki.com/b/222_88/97_98/25000.jpg</a><br><br>[00:29:10] &lt;@PALL&gt; &lt;br&gt;&lt;br&gt;&lt;img src='<a href="http://hotimg1.fotki.com/a/222_88/97_98/3353.jpg" class="postlink">http://hotimg1.fotki.com/a/222_88/97_98/3353.jpg</a> ' border=0 http://www2.lookpipe.com/get.php?filepath=http://hotimg1.fotki.com/a/222_88/97_98/3353.jpg" class="postlink">http://www2.lookpipe.com/get.php?filepa ... 8/3353.jpg</a> ');" onload='if(this.width&gt;<br><br>[00:29:12] &lt;@PALL&gt; <a href="http://hotimg1.fotki.com/a/222_88/97_98/3353.jpg" class="postlink">http://hotimg1.fotki.com/a/222_88/97_98/3353.jpg</a><br><br><br>I'm quite sure this results procs from the foreach line. If I removed the PRIVMSG line nothing comes out.<br><br>Edit:<br>I seem to get the idea that the -inline thing parses out info as such, so should I be making a statement where 1st line dont parse, 2nd line parse, 3rd line dont parse, 4th line parse, 5th line dont parse, 6 line parse.. etc so on? Just wanna confirm.<br><br>Also user, yes it is results parsed out from a php forum so its not entirely html... I tried regexp {='([^']+)'} but am still unable to parse out the link.php from the garbled text as I have with the .jpgs...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8781">kenneal</a> — Fri May 04, 2007 12:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2007-05-04T11:20:12-04:00</updated>

		<published>2007-05-04T11:20:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72521#p72521</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72521#p72521"/>
		<title type="html"><![CDATA[Retrieving text from messy strings, rgding -regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72521#p72521"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>{='([^']+)'}</code></pre></div>To get all the matches, I'd use the -all and -inline options (check the regexp manual page) and a foreach loop.<br>BTW: your examples are not html.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri May 04, 2007 11:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kenneal]]></name></author>
		<updated>2007-05-04T10:55:39-04:00</updated>

		<published>2007-05-04T10:55:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72518#p72518</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72518#p72518"/>
		<title type="html"><![CDATA[Retrieving text from messy strings, rgding -regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72518#p72518"><![CDATA[
regexp {&lt;.*?'(.*?\.jpg).*?&gt;} $htmlInput fullstringmatchvar exactmatchvar <br><br>I tried messing around with it works fine. I still have a few questions. <br>I want to get lets say a certain string that could be called<br><br><a href="http://www.abc.com/link.php?ref=123zxc" class="postlink">www.abc.com/link.php?ref=123zxc</a><br><br>or<br><br><a href="http://www.abc.com/link.php?ref=34zxz" class="postlink">www.abc.com/link.php?ref=34zxz</a><br><br>or <br><br><a href="http://www.abc.com/link.php?ref=SDASDASDASd" class="postlink">www.abc.com/link.php?ref=SDASDASDASd</a><br><br>They are embedded in codes like, <br><br>&lt;img src='<a href="http://www.abc.com/link.php?ref=SDASDASDASd" class="postlink">www.abc.com/link.php?ref=SDASDASDASd</a>' border=0&gt; <br>&lt;code='<a href="http://www.abc.com/link.php?ref=SDASDASDASd" class="postlink">www.abc.com/link.php?ref=SDASDASDASd</a>'&gt; <br>&lt;a code=1 file='<a href="http://www.abc.com/link.php?ref=SDASDASDASd" class="postlink">www.abc.com/link.php?ref=SDASDASDASd</a>' form=value &gt;<br><br>1) How could I go about retrieving them since the last part is always random?<br>2) What if in the string there is also another <a href="http://www.abc.com/link.php?ref=ZXCZXC" class="postlink">www.abc.com/link.php?ref=ZXCZXC</a> , regexp will only take out 1, is there another way I can take out the other?<br><br>I tried messing around with regexp but it still does not seem to work.. <br><br>Do appreciate your help here<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8781">kenneal</a> — Fri May 04, 2007 10:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-05-02T07:31:13-04:00</updated>

		<published>2007-05-02T07:31:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72440#p72440</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72440#p72440"/>
		<title type="html"><![CDATA[Retrieving text from messy strings, rgding -regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72440#p72440"><![CDATA[
Based on your examples:<div class="codebox"><p>Code: </p><pre><code>regexp {&lt;.*?'(.*?\.jpg).*?&gt;} $htmlInput fullstringmatchvar exactmatchvarOr:regexp {&lt;.*?'(http://.*?\.jpg).*?&gt;} etc</code></pre></div>I would've thought html would use double quotes " tho, not '  <br>Change the above example to use " if nec.<br><br>exactmatchvar is where your http.*jpg string will be stored.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Wed May 02, 2007 7:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kenneal]]></name></author>
		<updated>2007-05-04T10:56:40-04:00</updated>

		<published>2007-05-02T04:11:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72435#p72435</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72435#p72435"/>
		<title type="html"><![CDATA[Retrieving text from messy strings, rgding -regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72435#p72435"><![CDATA[
I have some html code over here which i would like to extract the .jpg from.<br>Sometimes it generates as many different forms<br><br>E.g.<br><br>&lt;img src='<a href="http://123.com/12345.jpg" class="postlink">http://123.com/12345.jpg</a>' border=0&gt;<br>&lt;code='<a href="http://123.com/12345.jpg" class="postlink">http://123.com/12345.jpg</a>'&gt;<br>&lt;a code=1 file='<a href="http://123.com/12345.jpg" class="postlink">http://123.com/12345.jpg</a>' form=value &gt;<br><br>Is there any definite way to just 100% get the <a href="http://123.com/12345.jpg" class="postlink">http://123.com/12345.jpg</a> out of the always randomed + garbled html tag? I do understand regexp only thing that since it could appear in many forms i'm not very sure what should be the best way.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8781">kenneal</a> — Wed May 02, 2007 4:11 am</p><hr />
]]></content>
	</entry>
	</feed>
