fork download
  1. #!/bin/bash
  2. s='Mon0 connected 1920x1200+0+0 0mm x 0 mm
  3. 1920x1200_c 59.95*
  4. Mon0 connected 1920x1200+0+0 0mm x 0 mm
  5. 1920x1200_c 59.95*
  6. Mon0 connected primary 1920x1200+0+1200 0mm x 0 mm
  7. 1920x1200_c 59.95*
  8. Mon0 connected 1029x1200+1920+1200 0mm x 0 mm
  9. 1920x1200_c 59.95*'
  10.  
  11. echo "$s" | grep -oP '\b\d+x\d+(?!(?:\+\d+\+)?\d)'
Success #stdin #stdout 0s 4948KB
stdin
Standard input is empty
stdout
1920x1200
1920x1200
1920x1200
1920x1200