mIRC Home    About    Download    Register    News    Help

Print Thread
#162406 17/10/06 06:41 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi
how would i get the word proxie out of exactly this string Nick:Proxie,
saying this string can be described as $2
Thank-You


Newbie
#162407 17/10/06 06:57 PM
Joined: Oct 2006
Posts: 14
H
Pikka bird
Offline
Pikka bird
H
Joined: Oct 2006
Posts: 14
if ($regex(input, $2, /Nick:(\w+)\x2C/)) echo $regml(input, 1)

#162408 17/10/06 07:08 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
its not working


Newbie
#162409 17/10/06 08:03 PM
Joined: Oct 2006
Posts: 14
H
Pikka bird
Offline
Pikka bird
H
Joined: Oct 2006
Posts: 14
It does what you asked. Are you sure you are asking what you want?

#162410 17/10/06 09:06 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Assuming the format is the same each time (separated by a colon and ended by a comma) you don't need to use a regular expression at all. $left($gettok($2, 2, 58),-1) should work just fine.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#162411 17/10/06 11:35 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
thank-you starbucks worked just fine. hero12 its possible i didnt implement your idea properly i need it for an on notice event to echo just part of that $2


Newbie
#162412 17/10/06 11:44 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Various methods include:

Remove "Nick:" and ","
$remove($2,Nick:,$chr(44))

Get just the text after the colon, except the last character (the comma)
$left($gettok($2,2,58),-1)

Same as above, but remove the comma rather than ignore the last character
$remove($gettok($2,2,58),$chr(44))

Basically the same as above, but get all the text between the ":" and the ","
$gettok($gettok($2,2,58),1,44)

Get just the first 6 characters starting at character 6
$mid($2,6,6)

Same as above, but calculate how long the nick is in case you're using this for more than just a 6 letter nick
$mid($2,6,$calc($len($2) - 6))

Pick whatever you like.


Invision Support
#Invision on irc.irchighway.net
#162413 20/10/06 12:52 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
wow. Thanks that was awesome help shocked


Newbie

Link Copied to Clipboard