syntax for /hadd is:
/hadd table key value

so:
/hadd servers $regml(1)
might not always yield the correct call. Like you indicated spaces will be interpreted as as a separation between key and value.

you could try something like:

/hadd servers $regml(2) $regml(1)

uid sounds unique and non spaced (then again that's just a guess!)

otherwise replace space within $regml(1) with something like "S1p1A1c1E" and $replacecs it back to a space when needed would be fail save enough.