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

	<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-09-16T07:07:50-04:00</updated>

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

		<entry>
		<author><name><![CDATA[iamdeath]]></name></author>
		<updated>2007-09-16T07:07:50-04:00</updated>

		<published>2007-09-16T07:07:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75966#p75966</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75966#p75966"/>
		<title type="html"><![CDATA[regexp issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75966#p75966"><![CDATA[
Thanks alot nml, that solved the issue. awyeah I could use your expression but I don't know how to place it I was afraid I might disturb the whole code when regsub is easy and safe to use or remove <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>Thanks once again awyeah and nml.<br><br>iamdeath<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5982">iamdeath</a> — Sun Sep 16, 2007 7:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-09-16T01:47:36-04:00</updated>

		<published>2007-09-16T01:47:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75964#p75964</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75964#p75964"/>
		<title type="html"><![CDATA[regexp issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75964#p75964"><![CDATA[
Well my idea was first to check with regexp to match the string and then proceed to substitute, you can substitute in many ways: regsub IS NOT the ONLY SOLUTION.<br><br>You can use nml's expression for regsub or use this then, lol:<br><div class="codebox"><p>Code: </p><pre><code>set text [lindex [split $text] 0] Three Runs [lrange [split $text] 2 end]</code></pre></div>This should also do the work for you, matches the two output strings you showed.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sun Sep 16, 2007 1:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-09-15T18:36:50-04:00</updated>

		<published>2007-09-15T18:36:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75962#p75962</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75962#p75962"/>
		<title type="html"><![CDATA[regexp issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75962#p75962"><![CDATA[
Untested, but I guess this should do the trick, based on your examples:<div class="codebox"><p>Code: </p><pre><code>regsub -all {([[:digit:].]+) 3 ([[:alpha:]]+)} $text {\1 Three Runs \2} out</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Sep 15, 2007 6:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[iamdeath]]></name></author>
		<updated>2007-09-15T10:57:33-04:00</updated>

		<published>2007-09-15T10:57:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75950#p75950</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75950#p75950"/>
		<title type="html"><![CDATA[regexp issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75950#p75950"><![CDATA[
Thanks for your reply awyeah but I dont think that will slve my problem ok let me tell you again, currently I am using this:<br><div class="codebox"><p>Code: </p><pre><code>regsub -all { 3 } $text " Three Runs " text</code></pre></div>That will make <strong class="text-strong">" 3 "</strong> into <strong class="text-strong">" Three Runs "</strong>, but I want some changes like:<br><br>If 3 has numbers before it and alphabet after it then make that <strong class="text-strong">" 3 "</strong> into <strong class="text-strong">" Three Runs "</strong><br><br>For ex:<br><div class="codebox"><p>Code: </p><pre><code>over 18.1 3 fuller over 19.4 3 This is a test</code></pre></div>I want that <strong class="text-strong">" 3 "</strong> to be turned into <strong class="text-strong">Three Runs</strong>. So it will look like:<br><div class="codebox"><p>Code: </p><pre><code>over 18.1 Three Runs fuller over 19.4 Three Runs This is a test</code></pre></div>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5982">iamdeath</a> — Sat Sep 15, 2007 10:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-09-15T09:07:32-04:00</updated>

		<published>2007-09-15T09:07:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75945#p75945</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75945#p75945"/>
		<title type="html"><![CDATA[Re: regexp issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75945#p75945"><![CDATA[
<blockquote class="uncited"><div>Hi<br>like this:<br><br>11.6 3 test --&gt; then turn 3 into Three</div></blockquote>To match this you can use this:<div class="codebox"><p>Code: </p><pre><code>#if $text is the string: "11.6 3 test"if {[regexp {^(([0-9.]{3,})|([0-9]{1,}))(\x20)(3)(\x20)([a-z]{1,})$} $text]} {#for substitution you can use regsub or string map#or you can do it this way:set text [split $text]set text [lindex $text 0] Three [lindex $text 2]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sat Sep 15, 2007 9:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[iamdeath]]></name></author>
		<updated>2007-09-15T00:46:00-04:00</updated>

		<published>2007-09-15T00:46:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75938#p75938</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75938#p75938"/>
		<title type="html"><![CDATA[regexp issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75938#p75938"><![CDATA[
Hi<br><br>Can you tell me how can I regexp a number which contains certain things before and after for ex:<br><br><br>I want to look for "3" but look for 3 only when 3 has a number before it and an alphabet after it and turn 3 into THREE.<br><br>like this<br><br>11.6 3 test --&gt; then turn 3 into Three<br><br>Turn Number three into Alphabet Three<br><br>but <br><br>if it's number 3 number then return<br>or if it's alphabet 3 alphabet return<br><br>Thanks<br>iamdeath<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5982">iamdeath</a> — Sat Sep 15, 2007 12:46 am</p><hr />
]]></content>
	</entry>
	</feed>
