Help for this page

Select Code to Download


  1. 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
    
  2. or download this
    s/^([^\s]*(?:\s[^\s]*){3})\s/$1\n/
    
  3. 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.