Konvertieren Sie Leerzeichen in Tabulatoren in RegEx

Wie sagt man das folgende in Regex:

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

Das habe ich bisher:

/^ +/\t/g

Dadurch wird jedoch jedes Leerzeichen in 1 Tab umgewandelt

Jede Hilfe wäre dankbar.

Antworten auf die Frage(3)

Ihre Antwort auf die Frage