- preg_match: documentation ( source)
<?php
$test = array('ahoj', 'blb', 'bla', 'blabla', '1_22x44','1_22x44a', 'a1_22x44');
$pattern = '/^(?![0-9]_[0-9]*x[0-9]*$).+$/';
foreach ($test as $t) {
echo $t.' : '.(preg_match($pattern, $t)?'yes':'no') ."\n\r";
}