This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

stripping

Old posts that have not been replied to for several years.
Locked
s
sirkrunch
Voice
Posts: 19
Joined: Wed Oct 09, 2002 2:36 am

stripping

Post by sirkrunch »

how do i go about stripping text
like i have a tcl that when some1 triggers it returns a result (ofcouse)
but Iwant to take out some of it
eg
<user>!search website
<bot>http://www.website.com

I would like it to be
<bot>www.website.com
removing eveything b4 the 2nd slash

and how do u use string length?

set x [string length[$text]
if ($x => 3) {

?? im new to tcl and not sure how the cmds are setout cheers
w
w0t

Post by w0t »

Code: Select all

set lnk "http://www.website.com"
regexp {//(.*)} $lnk g link
s
sirkrunch
Voice
Posts: 19
Joined: Wed Oct 09, 2002 2:36 am

Post by sirkrunch »

cheers
so this would work?

Code: Select all

   set line "[gets $openf]"
   regexp {/(.*)} $line g link
that will read off the openfile and have it like
/www.blah
??

and

Code: Select all

 set x [string length[$text]
 if ($x => 3) {
is that correct??[/code]
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

set url [string range $text 6 end]
if it's always in the "http://www..... format
Elen sila lúmenn' omentielvo
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Papillon wrote:

Code: Select all

set url [string range $text 6 end]
if it's always in the "http://www..... format

Papillon!!!!!
Thought you were going away for a year?? =p
Locked