Maybe $rand could be extended so it would work like the below.

$rand(a,z,1,999,A,Z,5,9) would return the same thing as below.

$rand(a,z) $+ $rand(1,999) $+ $rand(A,Z) $+ $rand(5,9)