mIRC Homepage
One thing I have been frustrated about for a long time is the lack of the repeating operator (syntax being: {min,max} in the regex engine. It would be wonderful if you could add that to the regex engine in mIRC. For more info see http://www.regular-expressions.info/repeat.html

Khaled, your program is great. Keep up the good work!
It works fine, you just have to enclose it inside capturing brackets or put the regex in a variable first. This is because mIRC sees the , as an argument separator for the identifier.

Method 1: //echo -a $regex(abc,/(?:.{1,3})/)

Method 2: //var %re = /.{1,3}/ | echo -a $regex(abc,%re)
mirc's regex libraries already support the {N,M} quantifier!

Code:
//var %regex = /lo{1,5}l/ | echo -a $regex(looool,%regex)


i suspect you're having trouble with that comma, trying to plug it into the regex directly:

Code:
//echo -a $regex(looool,/lo{1,5}l/)


reason that doesn't work is pretty much the same effect as putting a comma directly into any other identifier. in the above, $regex() is passed 3 parameters, name = looool, string = /lo{1 and regex = 5}l/

there's a workaround, you can put the comma inside a group of parentheses:

Code:
//echo -a $regex(looool,/(?:lo{1,5}l)/)


if enclosed in (), the comma is no longer seen as a parameter separator :>
Hm, maybe. But it would be usefull if we didn't have to do all that work grin
It's really not possible not to, since mIRC wouldn't be able to tell whether you're passing a name, a string and expression, or just a string and expression.
© mIRC Discussion Forums