Another request.

Allow input parameter to be a &binvar, if and only if, the output parameter is also &binvar.

$regsubex(name,&binvar,/pattern/,sub,&binvar)

Because there is currently no way to easily modify the contents of a binary variable without...

Code:
breplace &binvar 00 255
var %string = $bvar(&binvar,1-).text
noop $regsubex(,%string,/pattern/,sub,&binvar)

and this assumes that it's safe to replace $chr(00) to $chr(255).

Since $regsubex will only accept an input as a binary variable when there's an output binary variable, this should be perceivably backwards compatible for unlikely input of literal "&text" that's not intended to be a binary variable.

Though, my personal belief is that if someone really needs to pass "&text" literally to regex then they can place it inside a %variable first. So if you want, you could make it so all $regex functions are able to accept &binvar inputs naturally, without requiring a &binvar output too. Including $regex() which has no output variable parameter.


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