mIRC Homepage
Posted By: HaleyJ $regex help - 17/10/06 06:41 PM
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
Posted By: hero12 Re: $regex help - 17/10/06 06:57 PM
if ($regex(input, $2, /Nick:(\w+)\x2C/)) echo $regml(input, 1)
Posted By: HaleyJ Re: $regex help - 17/10/06 07:08 PM
its not working
Posted By: hero12 Re: $regex help - 17/10/06 08:03 PM
It does what you asked. Are you sure you are asking what you want?
Posted By: starbucks_mafia Re: $regex help - 17/10/06 09:06 PM
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.
Posted By: HaleyJ Re: $regex help - 17/10/06 11:35 PM
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
Posted By: Riamus2 Re: $regex help - 17/10/06 11:44 PM
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.
Posted By: HaleyJ Re: $regex help - 20/10/06 12:52 PM
wow. Thanks that was awesome help shocked
© mIRC Discussion Forums