$re = '/(?<brackets>[\[\]\(\)]){0}
?(?<tab><HT>){0}
?(?&tab)(?&brackets)?(?<longitude>[0-9\.]{1,})(?&brackets)?
?(?&tab)(?&brackets)?(?<latitude>[0-9\.]{1,})?(?&brackets)?
?(?&tab)(?&brackets)?(?<speed>[0-9\.]{1,6})?(?&brackets)?
?(?&tab)(?&brackets)?(?<azimut>[0-9\.]{1,6})?(?&brackets)?
?(?&tab)(?&brackets)?(?<IMEI>[0-9]{15})?(?&brackets)?
?(?&tab)(?&brackets)?(?<IMSI>[0-9]{15})?(?&brackets)?/';
$str = '<HT>(21.123456)<HT>(51.123456)<HT>(20.31)<HT>(120.48)<HT>(260032995142244)<HT>(355233057612051)
';
preg_match($re, $str, $matches, PREG_OFFSET_CAPTURE, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php