mIRC Home    About    Download    Register    News    Help

Print Thread
#175037 16/04/07 01:06 PM
Joined: Apr 2007
Posts: 1
F
Mostly harmless
OP Offline
Mostly harmless
F
Joined: Apr 2007
Posts: 1
Example this %var:
<a title="Text 1" href"Link 1">Blabla</a> <a title="Text 2" href"Link 2">Bleblel</a> <a title="Text 3" href"Link 3">Bloblo</a> <a title="Text 4" href"Link 4">Blubluuu..</a> <a title="Text 5" href"Link 5">lalala..</a> <a title="Text 6" href"Link 6">...........

And, i need take in echo, the text between <a title=" and " href", and later take link between href" and ">... And later, in other echo, take text2 and link2... 3... 4..... Is possible?? Whats is the code?

Last edited by faellzinhoo; 16/04/07 01:06 PM.
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Code:
alias regexloop {
  var %t = <a title="Text 1" href"Link 1">Blabla</a> <a title="Text 2" href"Link 2">Bleblel</a> <a title="Text 3" href"Link 3">Bloblo</a> <a title="Text 4" href"Link 4">Blubluuu..</a> <a title="Text 5" href"Link 5">lalala..</a> <a title="Text 6" href"Link 6">
  noop $regex(%t,/<a title="(.*?)" href"(.*?)">(.*?)<\/a>/gi)
  var %i = 1
  while ($regml(%i)) {
    var %title = $regml(%i) , %link = $regml($calc(%i + 1)) , %desc = $regml($calc(%i + 2))
    echo -a :: Link: %link ---> Title: %title ---> Desc: %desc
    inc %i 3
  }
}


However, I'm not sure what you're doing with: href"link"

Every time I see it, it's: href="LINK"

If it does have a "="
Then change: noop $regex(%t,/<a title="(.*?)" href"(.*?)">(.*?)<\/a>/gi)

To this: noop $regex(%t,/<a title="(.*?)" href="(.*?)">(.*?)<\/a>/gi)


Link Copied to Clipboard