PyraX Posted December 4, 2010 Share Posted December 4, 2010 im trying to find everything between <a href="javascript:void(0);" onclick="return false;"> and </a> Here is what I have tried but it didnt work preg_match_all('/<a href="javascript:void(0);" onclick="return false;">.*?</a>/',$data,$matches); Link to comment https://forums.phpfreaks.com/topic/220639-simple-php_match_all-pattern-question/ Share on other sites More sharing options...
JAY6390 Posted December 4, 2010 Share Posted December 4, 2010 preg_match_all('/<a href="javascript:void(0);" onclick="return false;">.*?</a>/s',$data,$matches); Link to comment https://forums.phpfreaks.com/topic/220639-simple-php_match_all-pattern-question/#findComment-1142863 Share on other sites More sharing options...
PyraX Posted December 4, 2010 Author Share Posted December 4, 2010 its giving me the error message: Warning: preg_match_all() [function.preg-match-all]: Unknown modifier 'a' in C:\AppServ\www\index.php on line 53 Link to comment https://forums.phpfreaks.com/topic/220639-simple-php_match_all-pattern-question/#findComment-1142869 Share on other sites More sharing options...
PyraX Posted December 4, 2010 Author Share Posted December 4, 2010 fixed it by doing preg_match_all('/onclick="return false;">.*?<\/a>/',$data,$matches); NEXT QUESTION How do I make it so that it doesnt include onclick="return false;"> and </a> in the results? Link to comment https://forums.phpfreaks.com/topic/220639-simple-php_match_all-pattern-question/#findComment-1142872 Share on other sites More sharing options...
JAY6390 Posted December 4, 2010 Share Posted December 4, 2010 preg_match_all('/onclick="return false;">(.*?)<\/a>/',$data,$matches); Link to comment https://forums.phpfreaks.com/topic/220639-simple-php_match_all-pattern-question/#findComment-1142873 Share on other sites More sharing options...
PyraX Posted December 4, 2010 Author Share Posted December 4, 2010 yay just got that too thanks Link to comment https://forums.phpfreaks.com/topic/220639-simple-php_match_all-pattern-question/#findComment-1142874 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.