<?php $str = 'xxABC1xxxABC2xx'; if ( preg_match('/x[A-Z]+\d(?!.*x[A-Z]+\d)/', $str, $match) ) print_r($match[0]);
You have javascript disabled. You will not be able to edit any code.