mIRC Homepage
Posted By: bapplander How to grab everything within ( ) ? - 16/07/07 03:07 PM
Hi, how can I grab everything thats inside ( here ) ?
like %stuff = <code>
Posted By: hixxy Re: How to grab everything within ( ) ? - 16/07/07 03:10 PM
Code:
var %stuff = ( here )
%stuff = $mid(%stuff,2,-1)
Posted By: NightChillz Re: How to grab everything within ( ) ? - 16/07/07 06:14 PM
//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 )
© mIRC Discussion Forums