egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

regexp returning values into variables stored in oneVariable

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
dwickie
Halfop


Joined: 21 Aug 2004
Posts: 76
Location: /pub/beer

PostPosted: Mon Feb 27, 2006 6:11 pm    Post subject: regexp returning values into variables stored in oneVariable Reply with quote

iam trying to do simple thing, there is example:

Code:

regexp -all {(.*)\s(.*)} - nick rank


this will store first (.*) into $nick and second (.*) into $rank, but if i will do it this way:

Code:

# because on some channels is it for example "rank nick"

set tmp "nick rank"
regexp -all {(.*)\s(.*)} - $tmp


this wont work :/ it will store first (.*) into variable ${nick rank}

i know solution is probably simple, but i cant figure it out. can someone help me? Smile
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Feb 27, 2006 7:14 pm    Post subject: Reply with quote

Try
Code:
set tmp {nick rank}
regexp -all {(.*)\s(.*)} - [lindex $tmp 0] [lindex $tmp 1]

in this case, you just have to change the order of nick and rank in tmp.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber