Convertir espacios a pestañas en RegEx

¿Cómo se dice lo siguiente en expresiones regulares:

foreach line
   look at the beginning of the string and convert every group of 3 spaces to a tab
   Stop once a character other than a space is found

Esto es lo que tengo hasta ahora:

/^ +/\t/g

Sin embargo, esto convierte cada espacio en 1 pestaña.

Cualquier ayuda sería apreciada.

Respuestas a la pregunta(3)

Su respuesta a la pregunta