<?php $str = 'xxABC1xxxABC2xx'; if ( preg_match_all('/x[A-Z]+\d/', $str, $matches, PREG_SET_ORDER) ) echo end($matches)[0];
You have javascript disabled. You will not be able to edit any code.