well, $str() makes a string of "\1", e.g. \1\1\1\1\1, which is perfectly ok for regsub.
//var %a = hello world | !.echo -q $regsub(%a, /(hello)/g,\1\1\1\1\,%a) | echo -a %a
hellohellohellohello world