Just tested and it doesn't appear to. I think the trimming effect you usually get with variables is just down to mIRC trimming spaces from the end of lines when a variable is being assigned. Luckily $regsub isn't limited by that.

It might not be the easiest code in the world to make or work with, but at least it's possible now. It's a hell of a lot better than the previous best method (reading /debug output).