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

	<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>2004-05-04T05:16:28-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-05-04T05:16:28-04:00</updated>

		<published>2004-05-04T05:16:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36097#p36097</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36097#p36097"/>
		<title type="html"><![CDATA[Removing colors etc from string.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36097#p36097"><![CDATA[
That worked fine! Thx!<p>Statistics: Posted by Guest — Tue May 04, 2004 5:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-05-03T11:04:07-04:00</updated>

		<published>2004-05-03T11:04:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36061#p36061</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36061#p36061"/>
		<title type="html"><![CDATA[Re: Removing colors etc from string.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36061#p36061"><![CDATA[
<blockquote class="uncited"><div>when I put the text into a mysql datbase some strings still have a  in them. Could someone help me with this? What did I forget to remove form the string?</div></blockquote>That "" is the mIRC control code for plain text. I think the proc you pasted is a bit overkill if you want to strip all control codes. Try this instead: <div class="codebox"><p>Code: </p><pre><code>proc mircstrip text {regsub -all {\002|\003([0-9]{1,2}(,[0-9]{1,2})?)?|\017|\026|\037} $text {} textset text}</code></pre></div><blockquote class="uncited"><div>I don't think  is a color, is it?</div></blockquote>you're right. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon May 03, 2004 11:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-05-03T06:12:34-04:00</updated>

		<published>2004-05-03T06:12:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36055#p36055</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36055#p36055"/>
		<title type="html"><![CDATA[Removing colors etc from string.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36055#p36055"><![CDATA[
Ok, this is the mirc code:<div class="codebox"><p>Code: </p><pre><code>2[14P-R-E2] 2[12MP31/121REAL2] 2[Jay_Epoch-Particles-Directions_In_Groove_(Proton)_28-03-2004-1REAL2]</code></pre></div>This is how it looks:<br><img src="http://www.abi-02.com/irc.jpg" class="postimage" alt="Image"><p>Statistics: Posted by Guest — Mon May 03, 2004 6:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-05-03T06:05:55-04:00</updated>

		<published>2004-05-03T06:05:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36053#p36053</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36053#p36053"/>
		<title type="html"><![CDATA[Removing colors etc from string.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36053#p36053"><![CDATA[
I don't think  is a color, is it? If not, why would a color stripper remove it?<br><br>Why don't you post some sample lines that cause that error.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Mon May 03, 2004 6:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-05-03T03:52:42-04:00</updated>

		<published>2004-05-03T03:52:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36052#p36052</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36052#p36052"/>
		<title type="html"><![CDATA[Removing colors etc from string.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36052#p36052"><![CDATA[
Hi, I want to parse the text of someone and put this into a mysql database. I found this function to remove colors from the post:<br><div class="codebox"><p>Code: </p><pre><code># mirc_strip [switches] &lt;text&gt;#     version:#       v1.0proc mc:sc:mirc_strip {{args ""}} {  mc:sc:badargs $args 1 7 "?switches? text"  set switches ""  for {set i 0} {[string match -* [set arg [lindex $args $i]]]} {incr i} {    if {![regexp -- {^-(all|bold|color|reverse|underline|-)$} $arg -&gt; switch]} {      set valid "-all -bold -color -reverse -underline {or --}"      error "bad switch \"$arg\": must be [join $valid ", "]"    }    if {$switch == "-"} {      incr i      break    }; lappend switches $switch  }  if {$switches == ""} {set switches all}  set arg [lindex $args $i]  mc:sc:badargs [lrange $args $i end] 1 1 "?switches? text"  set all [expr {([lsearch -exact $switches all] &gt;= 0) ? 1 : 0}]  set list ""  if {$all} {    set list [list \002 "" \017 "" \026 "" \037 ""]  } else {    if {[lsearch -exact $switches bold] &gt;= 0} {lappend list [list \002 ""]}    if {[lsearch -exact $switches plain] &gt;= 0} {lappend list [list \017 ""]}    if {[lsearch -exact $switches reverse] &gt;= 0} {lappend list [list \026 ""]}    if {[lsearch -exact $switches underline] &gt;= 0} {lappend list [list \037 ""]}  }  if {$all || ([lsearch -exact $switches color] &gt;= 0)} {    regsub -all -- "\003(\[0-9\]\[0-9\]?(,\[0-9\]\[0-9\]?)?)?" $arg "" arg  }  set arg [mc:sc:replace -- $arg [join $list]]  return $arg}</code></pre></div>But when I put the text into a mysql datbase some strings still have a  in them. Could someone help me with this? What did I forget to remove form the string?<br><br>Thx alot!<p>Statistics: Posted by Guest — Mon May 03, 2004 3:52 am</p><hr />
]]></content>
	</entry>
	</feed>
