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

	<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-06-02T15:32:20-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2008-06-02T15:32:20-04:00</updated>

		<published>2008-06-02T15:32:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83380#p83380</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83380#p83380"/>
		<title type="html"><![CDATA[Help with splitup a line!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83380#p83380"><![CDATA[
Using [scan] it can be done like this:<div class="codebox"><p>Code: </p><pre><code>scan $line "%s User: %s IRC: %s" ircidentnow username savedircident</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon Jun 02, 2008 3:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-06-02T06:20:45-04:00</updated>

		<published>2008-06-02T06:20:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83370#p83370</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83370#p83370"/>
		<title type="html"><![CDATA[Re: Help with splitup a line!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83370#p83370"><![CDATA[
<blockquote class="uncited"><div>I have this in a variable $line <div class="codebox"><p>Code: </p><pre><code>KuBuntU!~KuBuntU@xxxxxx.eu User: KuBuntU     IRC: KuBuntU!~KuBuntU@xxxxxx.eu  </code></pre></div>and i wanted this splited up as variable.<br>$ircidentnow $username $savedircident<br><br>the User: and IRC: i not want in any of variables.</div></blockquote><div class="codebox"><p>Code: </p><pre><code>regexp -- {(.+?)\sUSER\:\s(.+?)\sIRC\:\s(.+?)} $line -&gt; ircidentnow username savedircident</code></pre></div>-- or like this --<div class="codebox"><p>Code: </p><pre><code>regsub -all {(?:USER\:\s|IRC\:\s|\s\s)} $line "" lineset ircidentnow [lindex [split $line] 0]set username [lindex [split $line] 1]set savedircident [lindex [split $line] 2]</code></pre></div>Could've used 'scan' to do this as well, maybe. The top is easiest to accomplish, but if it cannot match this will not associate to any variables (it CAN fail). Eventually tcl errors or work arounds involving variables with empty contents/info exists checks will be required since at times this regexp pattern might not fit and run into code needing these variables.<br><br>The bottom way is better (it  CANNOT fail). It removes user:, <a href="irc" class="postlink">irc</a>:, and double spacing from $line. Then when it splits $line to form the list it aligns perfectly to your variable assignments.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Jun 02, 2008 6:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[KuBuntU]]></name></author>
		<updated>2008-06-02T04:29:48-04:00</updated>

		<published>2008-06-02T04:29:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83368#p83368</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83368#p83368"/>
		<title type="html"><![CDATA[Help with splitup a line!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83368#p83368"><![CDATA[
I have this in a variable $line <div class="codebox"><p>Code: </p><pre><code>KuBuntU!~KuBuntU@xxxxxx.eu User: KuBuntU     IRC: KuBuntU!~KuBuntU@xxxxxx.eu  </code></pre></div>and i wanted this splited up as variable.<br>$ircidentnow   $username  $savedircident<br><br>the User: and IRC: i not want in any of variables.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9965">KuBuntU</a> — Mon Jun 02, 2008 4:29 am</p><hr />
]]></content>
	</entry>
	</feed>
