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

	<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-11-20T08:23:34-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Jarek]]></name></author>
		<updated>2007-11-20T08:23:34-04:00</updated>

		<published>2007-11-20T08:23:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=78560#p78560</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=78560#p78560"/>
		<title type="html"><![CDATA[Regexp Problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=78560#p78560"><![CDATA[
<blockquote class="uncited"><div>You need to \escape the period(.) and you need to \escape the question mark(?)</div></blockquote>Thanks, mate! This was the right thing. I had to escape the special chars. Now it works!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9474">Jarek</a> — Tue Nov 20, 2007 8:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-11-19T21:56:09-04:00</updated>

		<published>2007-11-19T21:56:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=78554#p78554</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=78554#p78554"/>
		<title type="html"><![CDATA[Regexp Problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=78554#p78554"><![CDATA[
Half right, half wrong...<br>. would match any character, and would survive not being escaped.<br>? however does not match any characters by itself, but is used to match 0 or 1 occurances of the prefixed atom (in this case the character p). In this case it must be escaped.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Nov 19, 2007 9:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-11-19T19:29:25-04:00</updated>

		<published>2007-11-19T19:29:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=78553#p78553</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=78553#p78553"/>
		<title type="html"><![CDATA[Regexp Problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=78553#p78553"><![CDATA[
I don't think that would make much difference, as both . (dot) and ? are wildcard chars, so it should have matched the string.  <br><br>Is the var $html empty of data?   You don't handle any error conditions, so it could be that the data is not being retrieved.<br><br>Here is an example of getting html data and handling error conditions, then fishing out the data you want:<br><div class="codebox"><p>Code: </p><pre><code>set xeurl "http://www.xe.com/ucc/convert.cgi"set xequery [::http::formatQuery Amount "$amount" From "$fromcur" To "$tocur"]catch {set page [::http::geturl $xeurl -query $xequery -timeout $xeutimeout]} errorif {[string match -nocase "*couldn't open socket*" $error]} {        puthelp "PRIVMSG $nick :Error: couldn't connect to XE.com..Try again later"        ::http::cleanup $page        return}if { [::http::status $page] == "timeout" } {        puthelp "PRIVMSG $nick :Error: Connection timed out to XE.com."        ::http::cleanup $page        return}set html [::http::data $page]::http::cleanup $pageif {[regexp {&gt;Live rates at (.*?)&lt;/span&gt;} $html match xetime]} {        #some of the IF above has been deleted for this example        # manipulate the data:        regsub -all {&lt;!.*?&gt;} $fromamount {} fromamount        regsub -all {&lt;!.*?&gt;} $toamount {} toamount        puthelp "PRIVMSG $chan :XE.COM: \002$fromamount\002 equals \002$toamount\002 as of $xetime"} else {        puthelp "PRIVMSG $chan :Could not obtain results from XE.com, sorry!"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Mon Nov 19, 2007 7:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2007-11-19T18:21:46-04:00</updated>

		<published>2007-11-19T18:21:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=78552#p78552</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=78552#p78552"/>
		<title type="html"><![CDATA[Regexp Problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=78552#p78552"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>regexp {'/profile/index.php?profile_id=(.*?)'} $html fullmatch exactmatch</code></pre></div></div></blockquote><div class="codebox"><p>Code: </p><pre><code>regexp {'/profile/index\.php\?profile_id=(.*?)'} $html fullmatch exactmatch</code></pre></div>You need to \escape the period(.) and you need to \escape the question mark(?)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Nov 19, 2007 6:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Jarek]]></name></author>
		<updated>2007-11-19T13:08:58-04:00</updated>

		<published>2007-11-19T13:08:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=78545#p78545</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=78545#p78545"/>
		<title type="html"><![CDATA[Regexp Problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=78545#p78545"><![CDATA[
Hm, $exactmatch is empty after doing this. <br><br>My proc looks this like:<br><div class="codebox"><p>Code: </p><pre><code>proc poloniaflirt::internalCom { suche } {  set fullmatch ""  set exactmatch ""  set log1 [open pf.txt a]  set log2 [open reg.txt a]  set pfsearchurl "http://www.polonia-flirt.de/search/index.php"  set pfquery [::http::formatQuery sea_nickname "$suche" send "send"]  set page [http::config -useragent "Mozilla/4.0 (compatible\; MSIE 6.0\; Windows NT 5.0)"]  set page [::http::geturl $pfsearchurl -query $pfquery -timeout $poloniaflirt::pftimeout]  set html [::http::data $page]  puts $log1 "$html"  close $log1  regexp {'/profile/index.php?profile_id=(.*?)'} $html fullmatch exactmatch  puts $log2 "$exactmatch"  close $log2  return $page}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9474">Jarek</a> — Mon Nov 19, 2007 1:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-11-19T12:33:11-04:00</updated>

		<published>2007-11-19T12:33:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=78543#p78543</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=78543#p78543"/>
		<title type="html"><![CDATA[Regexp Problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=78543#p78543"><![CDATA[
Assuming the data is in a var called $html:<div class="codebox"><p>Code: </p><pre><code>regexp {'/profile/index.php?profile_id=(.*?)'} $html fullmatch exactmatch# the data you want will be in $exactmatch var.</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Mon Nov 19, 2007 12:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Jarek]]></name></author>
		<updated>2007-11-19T10:45:17-04:00</updated>

		<published>2007-11-19T10:45:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=78541#p78541</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=78541#p78541"/>
		<title type="html"><![CDATA[Regexp Problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=78541#p78541"><![CDATA[
Hi Folks. <br><br>I'd like to get the profile id value out of this line:<div class="codebox"><p>Code: </p><pre><code>&lt;td align="center"&gt;&lt;a class="profil_link" href="javascript:;" &gt;&lt;img class="td_border" src="/pictures/60x80/11-07/20129_47400a57eefb8.jpg" width="60" height="80" border="0" alt="jaroslove"&gt;&lt;/a&gt;&lt;/td&gt;</code></pre></div>How I've to build the regular expression to get the value "20129"?<br><br>Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9474">Jarek</a> — Mon Nov 19, 2007 10:45 am</p><hr />
]]></content>
	</entry>
	</feed>
