Fixed php warning with preg match and group