mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
hey guys... i'm a bit perplexed with this.. i'm not sure how i would parse a line like this..

sometext:.:[blah]:.:[blah]:.:[urlhere]:.:

i'm thinking to tokenize it.... what i want from the line is whats in the brackets and put'em in variable form.. the variables i'm not concerned abouts... it's how to go about this is what i'm stumped on...

if anyone could point me in the right direction with this.. or give me an example of how to go about it... it would be appreciated..

thanks in advance

Joined: Oct 2008
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2008
Posts: 36
$wildtok(sometext:.:[blah]:.:[blah]:.:[urlhere]:.:,[*],0,58) return total matches

$wildtok(sometext:.:[blah]:.:[blah]:.:[urlhere]:.:,[*],1,58) return [blah]

$wildtok(sometext:.:[blah]:.:[blah]:.:[urlhere]:.:,[*],2,58) return [blah]


$wildtok(sometext:.:[blah]:.:[blah]:.:[urlhere]:.:,[*],3,58) return [urlhere]


There's if in LIFE

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
All the information you need, and then some, is in mIRC's help file under /help token identifiers

Aside from $wildtok, as already shown, other possibilities include $gettok and /tokenize

Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
ok cool thanks guys... laugh

but for some reason i'm stuck on the url part now... i cant seem to be able to capture it in the variable..

[ http://somesite.net/udetails.php?id=0000&hit=0 ]

i could try to piece it together using $gettok, but thats lame.... i know there's a better way. i havnt really dealt with urls and parsing them out.. so i more clueless than normal..

any thoughts?

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
$regex.

Yes, this answer is intentionally vague. If you don't know what that identifier does by its name (or help file description) then you probably don't want to know / knowing won't help you-- unless of course someone here writes you a script.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I see that regex has already been specified as a response, but I'm not even going to try a regex code as I'm still having difficulties understanding/writing them.

However, I'm a bit surprised that something like
Code:
set %html $gettok($gettok(sometext:.:[blah]:.:[blah]:.:[urlhere]:.:,4,91),1,93)
doesn't work for you, as a quick test does show it working on mIRC 6.34



Link Copied to Clipboard