| View previous topic :: View next topic |
| Author |
Message |
dwickie Halfop
Joined: 21 Aug 2004 Posts: 76 Location: /pub/beer
|
Posted: Mon Feb 27, 2006 6:11 pm Post subject: regexp returning values into variables stored in oneVariable |
|
|
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?  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Feb 27, 2006 7:14 pm Post subject: |
|
|
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 |
|
 |
|