我有以下代码从输入中提取域名并将它们存储在一个数组中
foreach ($output as $domList)
{
$extensionList = explode(",", "org,com,net");
$pattern = '/(\s{0,}|\.)([-a-z0-9]+\.(' . implode("|", $extensionList) . '))\s{1,}/i';
$matches = array();
preg_match_all($pattern, $domList, $matches);
}
匹配[0] 包含提取的所有域
我如何修改它以提取子域?