首頁 > 後端開發 > php教程 > 这个正则如何匹配

这个正则如何匹配

WBOY
發布: 2016-06-13 10:06:08
原創
928 人瀏覽過

这个正则怎么匹配?
其中“联系人”和“联系人1”为联系人姓名,[email protected]@ss.com”为联系人邮箱,怎么讲他们匹配出来?

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->    
登入後複製
联系人 [email protected] [写信] [列出来信] [编辑]
<script>Num++</script>
联系人 [email protected] [写信] [列出来信] [编辑]
<script>Num++</script>


------解决方案--------------------
PHP code
$match = '/<td><a>]*?)>([^]*?)>([^        <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">[email protected]</a></td>
<td class="Addr_Td_Opt">[<a href="/coremail/fcg/ldmmapp?sid=FAGuWpCkWFJAmgYZ&funcid=compose&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>
<tbody>    <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">[email protected]</a></td>
<td class="Addr_Td_Opt">[<a href="/coremail/fcg/ldmmapp?sid=FAGuWpCkWFJAmgYZ&funcid=compose&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>
<tbody>    </tbody>
</table>
<script>Num++</script>begin;preg_match_all($match,$str,$arr);var_dump($arr);<div class="clear">
                 
              
              
        
            </div>
</tbody></a></td>
登入後複製
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板