True, could mean global as well, because it keeps searching for more matches after it made the first one - I got the name from a mIRC regex tutorials, so it kind of stuck with me :P. I found that if you use it with too many regex checks, it tends to slow down the script a bit, especially with sockets and complex regexes (as I found out with my own mudclient script).

Generally, I avoid using /g unless I want to make large substitutions where I expect the match to be in large chunks of the data, but for a simple if match it tends to work well without it (and a little faster). I also tend to use iswm to match and $regsubex to change where I can, but then again, it's just my personal preferences wink

Thanks for pointing out that you could set it to variable @ Horstl. It's generally the best when your trying to avoid syntax errors like the comma causes when in your regex.


GigIRC Network Admin
irc.gigirc.com