日期:2014-05-17  浏览次数:20530 次

这个正则怎么匹配?
其中“联系人”和“联系人1”为联系人姓名,“hddf@dd.com”和“sdfdf@ss.com”为联系人邮箱,怎么讲他们匹配出来?
PHP code

    <table class="Addr_setTable Addr_setTable_Con">
        <tbody><tr>
            <td class="Addr_Td_Checkbox"><input type="checkbox" name="chk-_0_0_" value="hddf%40dd.com"  ></td>
<td class="Addr_Td_Name"><a href="ldvcapp?funcid=prtsearchres&sid=FAGuWpCkWFJAmgYZ&iid=0&mode=1&emptymode=1&print.x=1&tempname=address/add.htm">联系人</a></td>
<td class="Addr_Td_Address"><a href="ldvcapp?funcid=prtsearchres&sid=FAGuWpCkWFJAmgYZ&iid=0&mode=1&emptymode=1&print.x=1&tempname=address/add.htm">hddf@dd.com</a></td>
<td class="Addr_Td_Opt">[<a href="/coremail/fcg/ldmmapp?sid=FAGuWpCkWFJAmgYZ&amp;funcid=compose&amp;to=%22%B5%C4%B7%A2%C9%FA%B5%D8%22%20%3Chddf%40dd.com%3E" target="_parent">写信</a>] [<a href="ldsrchapp?funcid=srchhand&sid=FAGuWpCkWFJAmgYZ&word=hddf%40dd.com&fromonly=yes&fid=0&subfolder=yes&perfectmatch=1&rtnurl=" target="_parent">列出来信</a>] [<a href="ldvcapp?funcid=loadiadd&iid=0&sid=FAGuWpCkWFJAmgYZ&ifirstv=&lid=&modify.x=1">编辑</a>]</td>

        </tr>        
        <tbody>
    </table>

<script>Num++</script>







<!--   2-->
        
    <table class="Addr_setTable Addr_setTable_Con">

        <tbody><tr>
            <td class="Addr_Td_Checkbox"><input type="checkbox" name="chk-_0_1_" value="sdfdf%40ss.com"  ></td>
<td class="Addr_Td_Name"><a href="ldvcapp?funcid=prtsearchres&sid=FAGuWpCkWFJAmgYZ&iid=1&mode=1&emptymode=1&print.x=1&tempname=address/add.htm">联系人</a></td>
<td class="Addr_Td_Address"><a href="ldvcapp?funcid=prtsearchres&sid=FAGuWpCkWFJAmgYZ&iid=1&mode=1&emptymode=1&print.x=1&tempname=address/add.htm">sdfdf@ss.com</a></td>
<td class="Addr_Td_Opt">[<a href="/coremail/fcg/ldmmapp?sid=FAGuWpCkWFJAmgYZ&amp;funcid=compose&amp;to=%22sfsdd%22%20%3Csdfdf%40ss.com%3E" target="_parent">写信</a>] [<a href="ldsrchapp?funcid=srchhand&sid=FAGuWpCkWFJAmgYZ&word=sdfdf%40ss.com&fromonly=yes&fid=0&subfolder=yes&perfectmatch=1&rtnurl=" target="_parent">列出来信</a>] [<a href="ldvcapp?funcid=loadiadd&iid=1&sid=FAGuWpCkWFJAmgYZ&ifirstv=&lid=&modify.x=1">编辑</a>]</td>
        </tr>        
        <tbody>
    </table>

<script>Num++</script>






------解决方案--------------------
PHP code


$match = '/<td(?:.*?)Addr_Td_Name(?:.*?)><a(?:[^>]*?)>([^<]*?)<(?:.*?)Addr_Td_Address(?:.*?)<a(?:[^>]*?)>([^<]*?)</is';
$str = <<<begin

    <table class="Addr_setTable Addr_setTable_Con">
        <tbody><tr>
            <td class="Addr_Td_Checkbox"><input type="checkbox" name="chk-_0_0_" value="hddf%40dd.com"  ></td>
<td class="Addr_Td_Name"><a href="ldvcapp?funcid=prtsearchres&sid=FAGuWpCkWFJAmgYZ&iid=0&mode=1&emptymode=1&print.x=1&tempname=address/add.htm">联系人</a></td>
<td class="Addr_Td_Address"><a href="ldvcapp?func