mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2015
Posts: 3
A
Aotik Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: May 2015
Posts: 3
Hi,

So basically I have a function here to check for this regex (searching for image links).

Code:
if ($regex($1-, /(https?:\/\/.*\.(?:png|jpg))/i)) {
    var %s = link_ $+ $ticks $+ $rand(1,1000000)
    if ($sock(%s)) { sockclose %s }
    sockopen %s hkbot.io 80
    sockmark %s $nick $chan $1
  }


On this line
Code:
sockmark %s $nick $chan $1
I want to have the link URL found so that it would be

Code:
sockmark %s $nick $chan %linkfound


If anyone could give some insight on how this would be possible, that would be awesome. Thanks wink

Last edited by Aotik; 30/05/15 10:52 AM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Are you looking for $regml(1)?

Joined: May 2015
Posts: 3
A
Aotik Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: May 2015
Posts: 3
Will that return "http://i.imgur.com/FY1AbSo.gif" for example in the phrase "Here is a link http://i.imgur.com/FY1AbSo.gif" ? Ill try it out soon smile

Joined: May 2015
Posts: 3
A
Aotik Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: May 2015
Posts: 3
Works beautifully, thanks mate!


Link Copied to Clipboard