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.
Old posts that have not been replied to for several years.
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Tue Mar 05, 2002 4:41 am
Hi,
need a sugestion for how to split the next stuff..
I got this line: "arg1 arg2 arg3 arg4 arg5" and I want to make this line without "arg3". I was thinking to use some split from first arg to arg 3 and hen from arg 3 to the end. Any oher sugestion for this?
Thx!
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Tue Mar 05, 2002 7:37 am
You can do it pretty simply with regsub.
regsub {(.* .* ).* (.* .* .*)} $line {12} newline
You can also do it pretty simply with lreplace.
set newline [join [lreplace [split $line] 2 2]]
Petersen
Owner
Posts: 685 Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK
Post
by Petersen » Tue Mar 05, 2002 7:40 am
blah, stdragon replyed same time as me with much better solution than me (actually i did think about it, but couldnt be bothered working out the regsub
)
<font size=-1>[ This Message was edited by: Petersen on 2002-03-05 04:41 ]</font>
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Tue Mar 05, 2002 11:17 am
Hi, give me a clue about "regsub" stuff pls. With the spliting part I can manage preaty good now, or I think i do.
Thx!
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Mar 06, 2002 4:30 am
Me again!
I found some clues about this regsub and made this nice code:
set args "arg1 arg2 arg3 arg4 arg5"
bind pub * !chk chk_chan
proc chk_chan {nick host handle chan arg} {
regsub -all "arg3" $list "" list
putserv "PRIVMSG $chan :$list"
}
Cool man! works great. Thx for the tip.