I am still trying to get the hang of my regexs

Say I have the variable

$screen_resolution=1024x768;

How do I use preg_match to give me the width and the height from the variable.

I reckon it is something like;

PHP Code:
$str='1024x768';

preg_match('^[0-9]+$x'$str$matches);

echo 
"$matches"
thanks