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

	<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>2012-01-17T12:09:17-04:00</updated>

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

		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2012-01-17T12:09:17-04:00</updated>

		<published>2012-01-17T12:09:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98562#p98562</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98562#p98562"/>
		<title type="html"><![CDATA[regexp help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98562#p98562"><![CDATA[
The best way to check simple regular expressions is to use test data in a command line Tcl shell. If<br>you have enabled tcl/set commands in the bot's .conf file then this can be done on the party line.<br><br>As an example<br><br>1. Define the regular expression pattern as per the first such statement in your code<br>.tcl set regexp {^XDCC Server Active Sends:«(.*?)» Queues:«(.*?)» *$}<br>Tcl: ^XDCC Server Active Sends:?(.*?)? Queues:?(.*?)? *$<br><br>2. Execute the regular expression using the corresponding test data you provided<br>.tcl regexp -nocase -- $regexp "XDCC Server Active Sends:«0/3» Queues:«0/50»" -&gt; OpenSlots<br>Tcl: 1<br><br>3. Check the value of the captured variable<br>.tcl set OpenSlots<br>Tcl: 0/3<br><br>Note that you have defined two capture groups with the parenthesis in your regular expression pattern, but<br>only one captured variable in the actual regular expression. All is well if you want the text from the first<br>capture group. ie. OpenSlots == Active Sends. If however you want the second capture group then you could<br>possibly redefine your regular expression as follows, with two captured variables (one a dummy only)<br><br>.tcl regexp -nocase -- $regexp "XDCC Server Active Sends:«0/3» Queues:«0/50»" -&gt; dummy OpenSlots<br>Tcl: 1<br><br>.tcl set OpenSlots<br>Tcl: 0/50<br><br>Sorry I can't be more specific regarding possible errors elsewhere, I just wanted to give you a way of solving<br>your own problem. I think I can safely say I rarely define a regular expression that works first time. These<br>command line tools are a necessity for me.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Tue Jan 17, 2012 12:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ukd4v1d]]></name></author>
		<updated>2012-01-14T05:51:56-04:00</updated>

		<published>2012-01-14T05:51:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98526#p98526</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98526#p98526"/>
		<title type="html"><![CDATA[regexp help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98526#p98526"><![CDATA[
I'm having a little trouble getting regexp to pick up what i want from txt in channel<br>I've shaped a script to capture data spoken in channel to add to an SQL Database. There are different types of lines im looking to capture but my code is only picking up partial data.<br><br>My ever growing list of FAQ's and Game Walkthroughs are shared via X**C Bots either ran from my server or from writers own mIRC Scripts<br><br>Sample Data and code can be seen here<br><a href="http://pastebin.com/4tB6AQK8" class="postlink">http://pastebin.com/4tB6AQK8</a><br><br>Any help would greatly be appreciated<br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10468">ukd4v1d</a> — Sat Jan 14, 2012 5:51 am</p><hr />
]]></content>
	</entry>
	</feed>
