$regsubex() is unmistakably more powerful than $regsub() with respect to the type of substitutions possible. However, one crippling drawback with $regsubex() is that its results cannot be stored directly back into a %variable the same way it is with $regsub() and so any consecutive spaces are collapsed. The only work around is to constantly $replace($regsubex(),$chr(32),$LF) and then somehow try to manipulate $LF back into $chr(32) later on, often with a $regsub() command, or a combination of /bset and /breplace. Or the following example:

var %parseline
noop $regsub(a,$regsubex(b,$parseline,/pattern/g,subtext),,,%parseline)


Where the outer $regsub() is being used for no other purpose than to assign the output of $regsubex() to the variable %parseline before its multiple consecutive spaces get collapsed by mIRC's parser. Maybe $regsubex() could support its own output variable.

It'd also be extremely fancy if more such string handlers could support &binvars. PCRE already supports binary data. wink

Last edited by Raccoon; 06/03/17 05:52 PM.

Well. At least I won lunch.
Good philosophy, see good in bad, I like!