title: sed regex to find monitor resolution
body: <p>Using <code>xrandr | grep '*'</code> I would like to find the x resolution of all monitors on our network. This is to assist in the automatic placement of xterms in other scripts.</p>
  
  <p>Some of our systems are running redhat 6.4 and others redhat 5.8 and the results of xrandr differs depending on redhat version</p>
  
  <p>For redhat 6.4 <code>xrandr | grep '*'</code> returns</p>
  
  <p><code>1680x1050      60.0*+</code></p>
  
  <p>and for redhat 5.8 </p>
  
  <p><code>*0   1680 x 1050   ( 474mm x 303mm )  *50</code></p>
  
  <p>I have tried <code>xrandr | grep '*' | sed 's/\s+\(\d\{4\}\)\s*x\s*\d+/\1/'</code> but this returns the same string as highlighted above for 5.8 and 6.4. The desired output is 1680 in both cases</p>
  
  <p>Any hints?</p>