There's no need to replace spaces, as they are being enclosed in (- -). smile Ccontrol codes will skew the result
Code:
test {
  var %x = 1,%y
  while $mid($strip($1-), %x, 1) {
    %y = %y $+ (- $+ $ifmatch $+ -)
    inc %x
  }
  return %y
}
(-t-)(-e-)(-s-)(-t-)(-i-)(-n-)(-g-)(- -)(-t-)(-h-)(-i-)(-s-)(-,-)(- -)(-O-)(-K-)(-?-)