本体><"/> <本体><">
この正規表現を照合するにはどうすればよいでしょうか?
このうち、「Contact」と「Contact 1」は連絡先名、「hddf@dd.com」と「sdfdf@ss.com」は連絡先メールアドレスです。
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> <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&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> </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&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> </table> <script>Num++</script>
$match = '/<td(?:.*?)Addr_Td_Name(?:.*?)><a(?:[^>]*?)>([^<]*?) <(?:.*?)Addr_Td_Address(?:.*?)<a(?:[^>]*?)>([^<]*?)</is'; $str = <<<開始 <テーブルクラス="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&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>] </tr> <みんな> </テーブル> <script>Num++</script> <!-- 2--> <テーブルクラス="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&funcid=compose&to=%22sfsdd%22%20%3Csdfdf%40ss.com%3E" ターゲット="_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> <みんな> </テーブル> <script>Num++</script> 始める; preg_match_all($match,$str,$arr); var_dump($arr); <div class="clear"></div>