fork download
  1. #!/bin/bash
  2. s="hello dear world"
  3. perl -lne 'print "$1" while /\b(?=(\w+\s+\w+))/g' <<< "$s"
Success #stdin #stdout 0.01s 5424KB
stdin
Standard input is empty
stdout
hello dear
dear world