Modernvox Posted December 30, 2009 Share Posted December 30, 2009 Hi guys. I am wanting to scrape just the link, title and location from each post: I have bolded the first one so you may see the text I want to get. <p><a href="/muc/1529797723.html">rock band needs vocals -</a><font size="-1"> (ri)</font></p> <p><a href="/muc/1529790821.html">bass player available -</a><font size="-1"> (newport area)</font></p> Any help is appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/186648-wanting-to-use-characters-between-tags/ Share on other sites More sharing options...
Goldeneye Posted December 30, 2009 Share Posted December 30, 2009 This should work (I tested it with your provided example). '/<a href="([^"]+)">([^<]+)<\/a><font size="-1">([^"]+)<\/font>/i' This expression will return an array with 4 elements (if run through preg_match or preg_match_all): Array ( [0] => <a href="/muc/1529797723.html">rock band needs vocals -</a><font size="-1"> (ri)</font> [1] => /muc/1529797723.html [2] => rock band needs vocals - [3] => (ri) ) Quote Link to comment https://forums.phpfreaks.com/topic/186648-wanting-to-use-characters-between-tags/#findComment-985866 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.