<a href="http://newday.com/song.mp3">First Link</a>
<div id="right_song">
<div style="font-size:15px;"><b>Pitbull ft. Chris Brown - Pitbull feat. Chris Brown - International Love mp3</b></div>
<div style="clear:both;"></div>
<div style="float:left;">
<div style="float:left; height:27px; font-size:13px; padding-top:2px;">
<div style="float:left;">
<a href="http://secondurl.com/thisoneshouldonlyoutput" rel="nofollow" target="_blank" style="color:green;">Second Link</a></div>';
pregmatch_all을 사용하여이 HTML에서 두 번째 링크를 가져오고 싶습니다. 나의 현재 정규식은 다음과 같습니다URL을 찾는 정규식
preg_match_all("/\<a.+?href=(\"|')(?!javascript:|#)(.+?)\.mp3(\"|')/i", $html, $urlMatches);
이 잘 작동 나는 두 개의 링크 출력을 얻을 수 있지만, 나는 단지 두 번째는 .MP3 확장자없이 출력되고 싶어요. 나에게
우리는 HTML DOM 파서 정규식 – DevZer0
구문 분석 HTML DOM과 HTML을 구문 분석하지 않습니다 - http://simplehtmldom.sourceforge.net/ – DivinusVox
내가 정규식을 사용하지 않도록 알고 그러나 나는 잠시 동안해야한다. 어떤 도움이 필요합니까? –