을 구문 분석 : 그것은 괄호의 문제이다 나는 그것이정규 표현식 코드를 참조하십시오 HTML
array(
1 =>
array
0 => string 'G・R',
2 =>
array
0 => string> 'G-R'
)
을 반환 할
$result = "<b>Associated Names</b> [<a href='http://www.examples.com/authors.html?act=change&id=6141&item=associated'><u>Edit</u></a>]</td>
</tr>
<tr>
<td class='text' align='left'>G・R<br />G-R<br /> </td>"
preg_match_all("/<b>Associated Names.{10,100}<td class='text' align='left'>((.*<br \/>)*).*<\/td>/sU", $result, $assoc);
var_dump($assoc);
-----------------------------------------------------------
RESULT
array
0 =>
array
0 => string '<b>Associated Names</b></td>
</tr>
<tr>
<td class='text' align='left'>G・R<br />G-R<br /> </td>' (length=135)
1 =>
array
0 => string '' (length=0)
2 =>
array
0 => string '' (length=0)
(. (는)) 내가 그것을 해결하려면, 도와주세요 나
정규식과 일치하는 대상은 무엇입니까? – quantumSoup
정규식을 사용하여 HTML을 구문 분석하지 않는 것이 가장 좋습니다. 대신 HTML 구문 분석기를 사용해보십시오. –
"Ask Question"페이지에서 정규 표현식으로 HTML을 구문 분석하지 말라는 메시지를 표시 할 수 있습니까? –