使用php的Regex域

使用php的Regex域,php,regex,Php,Regex,我得到的html源代码包括以下域,而不是http:// 例: 如何处理常规的Expresion导出域?您可以这样做来提取域 <?php $content ="<table> <tr><td>abc.com</td></tr> <tr><td>abc.net</td></tr> <tr><td>abc.com.vn</td></tr> &

我得到的html源代码包括以下域,而不是http://

例:


如何处理常规的Expresion导出域?

您可以这样做来提取域

<?php
$content ="<table>
<tr><td>abc.com</td></tr>
<tr><td>abc.net</td></tr>
<tr><td>abc.com.vn</td></tr>
<tr><td>abc.vn</td></tr>
</table>";
preg_match_all('/<td>(.*?)<\/td>/', $content, $matches);
print_r($matches[1]);
<?php
$content ="<table>
<tr><td>abc.com</td></tr>
<tr><td>abc.net</td></tr>
<tr><td>abc.com.vn</td></tr>
<tr><td>abc.vn</td></tr>
</table>";
preg_match_all('/<td>(.*?)<\/td>/', $content, $matches);
print_r($matches[1]);
Array
(
    [0] => abc.com
    [1] => abc.net
    [2] => abc.com.vn
    [3] => abc.vn
)