mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2005
Posts: 39
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Mar 2005
Posts: 39
Hi, how can I grab everything thats inside ( here ) ?
like %stuff = <code>

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
var %stuff = ( here )
%stuff = $mid(%stuff,2,-1)

Joined: Dec 2002
Posts: 271
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 271
//var %stuff = (stuff inside brackets) blah blah (more stuff) blah (and even more stuff here) how about (this is the final sstuff), %matches = $regex(%stuff,/\((.*?)\)/gi), %cur = 1 | while (%cur <= %matches) { echo -a match# $+ %cur $+ : $regml(%cur) | inc %cur }


key parts being:


$regex(%stuff,/\((.*?)\)/gi)

and

$regml(N) to get the Nth match for items found within ( and )


Link Copied to Clipboard