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

	<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-08-05T18:14:02-04:00</updated>

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

		<entry>
		<author><name><![CDATA[BCyo+8C4]]></name></author>
		<updated>2008-08-05T18:14:02-04:00</updated>

		<published>2008-08-05T18:14:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84419#p84419</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84419#p84419"/>
		<title type="html"><![CDATA[replace every &quot;*&quot; in string]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84419#p84419"><![CDATA[
nvm, just figured it out:<div class="codebox"><p>Code: </p><pre><code>regsub -all {\*|!} $mask {\\\0} mask</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8166">BCyo+8C4</a> — Tue Aug 05, 2008 6:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-08-05T18:06:20-04:00</updated>

		<published>2008-08-05T18:06:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84418#p84418</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84418#p84418"/>
		<title type="html"><![CDATA[replace every &quot;*&quot; in string]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84418#p84418"><![CDATA[
That's odd... which version of tcl are you using?<br>Most versions of tcl have the varName argument optional. Nevertheless, try using something like this instead then:<div class="codebox"><p>Code: </p><pre><code>regsub -all -- {\*|!} $mask {\\\0} maskedString</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Aug 05, 2008 6:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BCyo+8C4]]></name></author>
		<updated>2008-08-05T17:59:01-04:00</updated>

		<published>2008-08-05T17:59:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84417#p84417</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84417#p84417"/>
		<title type="html"><![CDATA[replace every &quot;*&quot; in string]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84417#p84417"><![CDATA[
doesn't work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br>Tcl error [delban]: wrong # args: should be "regsub ?switches? exp string subSpec varName"<br>Entered the command exactly like you said, only changed the variable names: <div class="codebox"><p>Code: </p><pre><code>set maskedString [regsub -all -- {\*|!} $mask {\\\0}]</code></pre></div>also tried with just "{\*}" as expression but that failed as well.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8166">BCyo+8C4</a> — Tue Aug 05, 2008 5:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-08-05T13:18:08-04:00</updated>

		<published>2008-08-05T13:18:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84416#p84416</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84416#p84416"/>
		<title type="html"><![CDATA[replace every &quot;*&quot; in string]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84416#p84416"><![CDATA[
Regsub with a regular expression:<br><div class="codebox"><p>Code: </p><pre><code>set maskedString [regsub -all -- {\*|!} $oldString {\\\0}]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Aug 05, 2008 1:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BCyo+8C4]]></name></author>
		<updated>2008-08-05T12:22:21-04:00</updated>

		<published>2008-08-05T12:22:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84415#p84415</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84415#p84415"/>
		<title type="html"><![CDATA[replace every &quot;*&quot; in string]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84415#p84415"><![CDATA[
Hi,<br>I'm keeping the channels banlist in a text file but got a problem removing the entries from that file as I can't figure out how to escape the asterisks.<br><br>sed expects every "*" and "!" to be escaped like "\*" and "\!"<br><br>What's the easiest way to replace _every_ "*" with "\*" in a given string? (Replacing just one isn't a problem, but for 5 my code had around 50 lines and is fugly)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8166">BCyo+8C4</a> — Tue Aug 05, 2008 12:22 pm</p><hr />
]]></content>
	</entry>
	</feed>
