mIRC Home    About    Download    Register    News    Help

Print Thread
help needed with tokenizing..maybe? #204820 02/10/08 04:28 PM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
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

Re: help needed with tokenizing..maybe? [Re: clutz1572] #204821 02/10/08 05:50 PM
Joined: Oct 2008
Posts: 36
Rumieus Offline
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

Re: help needed with tokenizing..maybe? [Re: clutz1572] #204825 03/10/08 12:47 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
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

Re: help needed with tokenizing..maybe? [Re: clutz1572] #204857 04/10/08 04:57 AM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
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?

Re: help needed with tokenizing..maybe? [Re: clutz1572] #204862 04/10/08 07:09 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
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"
Re: help needed with tokenizing..maybe? [Re: clutz1572] #204865 04/10/08 10:45 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
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