mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 54
L
laz Offline OP
Babel fish
OP Offline
Babel fish
L
Joined: Dec 2002
Posts: 54
Ok I want to get the info between 2 quotation marks. I think I'll explain this better with an example:

%test Hi "Hello" "..." more stuff "BLAH"

Say if I only wanted to get stuff that is in the quotation marks (which would be "Hello ... BLAH").

Any ideas?

Joined: Dec 2002
Posts: 40
L
Ameglian cow
Offline
Ameglian cow
L
Joined: Dec 2002
Posts: 40
/help $gettok
Code:
test {
var %test = $gettok(Hi "Hello" "..." more stuff "BLAH",1,34) $gettok(Hi "Hello" "..." more stuff "BLAH",4,34) $gettok(Hi "Hello" "..." more stuff "BLAH",6,34)
}

that will do what you specified though it could probably be done cleaner you'll just have to look for yourself


Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Code:

alias quoted.stuff.only {
  var %string, %i = $iif("* iswm $1,1,2)
  while ($gettok($1-,%i,34)) { %string = %string $ifmatch | inc %i 2 }
  echo -ati2 " $+ %string $+ "
}

/quoted.stuff.only Hi "Hello" "..." more stuff "BLAH"
"Hello ... BLAH"

Last edited by Hammer; 03/01/03 09:05 AM.

DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Code:
alias quoted {
  var %r,%i = 1
  .!echo -q $regex($1-,/\x22(\S*?)\x22/g)
  while ($regml(%i)) { var %r = %r $ifmatch | inc %i }
  if (%r) return $+(",%r,")
}
//echo -a $quoted(Hi "Hello" "..." more stuff "BLAH")
"Hello ... BLAH"


Link Copied to Clipboard