Hey,

$regsubex(@Gandalf %Legolas @Brave,/\[@&~]/g,\1) removes "%legolas" because it's a variable name and it evaluates to $null, not because of the regex you're doing. your expression /\[@&~]/g is invalid and result in mIRC returning the original input string, and you're using \1 but your expression has no capturing group in the expression with (), so it doesn't make sense anyway.

Your second example is all the same, except there's no variable, so the original input string is returned.

If you want to 'remove' token seperated by space in the input string, you would use a pattern such as /(?<=^| )[@&~][^ ]+(?=$| )/g, $regsubex(@a c @a d @a,/(?<=^| )[@&~][^ ]+(?=$| )/g,) returns "c d"


#mircscripting @ irc.swiftirc.net == the best mIRC help channel