- or download this
$ perl -le '$_="1 2 3 4 5 6"; s/^((?:[^\s]*\s){3}[^\s]*)\s/$1\n/ and p
+rint'
1 2 3 4
5 6
- or download this
s/^([^\s]*(?:\s[^\s]*){3})\s/$1\n/
- or download this
s/
^ # Start at the beginning.
...
) # Stop capturing.
\s # Match another space.
/$1\n/x # Replace with what we captured and a newline.