fork download
  1. #!/bin/bash
  2. s="123 1 2 3 - works, the first number is two+ digits, the rest are one digits
  3. 1 2 3 45 - does not work, the first number is one-digit
  4. 14 2 3 4 - works
  5. 123 a2 - not output as expected as there is just one number
  6. 12 and one 1 more and 23 and 6 and some more 3546
  7. hello 123 my 1 name 2 is 3 - output fine since the first number is three-digit and the rest are one digit"
  8.  
  9. grep -E '(\<[[:digit:]]+\>.*){4,}' <<< "$s"
  10.  
Success #stdin #stdout 0.01s 5536KB
stdin
Standard input is empty
stdout
123 1 2 3  - works, the first number is two+ digits, the rest are one digits
14 2 3 4 - works
hello 123 my 1 name 2 is 3 - output fine since the first number is three-digit and the rest are one digit