mIRC Homepage
Posted By: Nillen Print $1- to variable - 05/03/14 03:14 AM
Code:
     var %links /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56( $+ %domains $+ )\b/iS
    if ($regex($1-,%links)) { 

I've been using that code for the longest time. Now, I'm trying to make a whitelist, I was thinking I could use the %links and set a switch on that. But I tried printing the variable by Msg # %links and I obviously get this:
Code:
 /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk|se|tv|html|ly)\b/iS 


How would I proceed to single out the link from $1- and print that to a variable instead?
Posted By: Iire Re: Print $1- to variable - 05/03/14 07:35 PM
$regml(1) will return the part of a string last checked against a regex identifier (such as $regex()) that matches the regex pattern first (if groups are used)

For example, if you have:
Code:
$regex(good morning,/(mor)/Si)


then $regml(1) will return mor

Of course, you will have to use $regml(1) after the $regex($1-,%links)
Posted By: Nillen Re: Print $1- to variable - 06/03/14 02:13 AM
Ah, thank you kindly good sir. Just what I was looking for smile
© mIRC Discussion Forums