ctcmedia Posted November 5, 2009 Share Posted November 5, 2009 Having a couple of problems with regexing the following code <p> <strong>10am</strong> <br/> <strong>Match 1</strong> – BLAH BLAH <br/> <strong>Match 2</strong> – BLAH BLAH <br/> <strong>Match 3</strong> – BLAH BLAH <br/> <strong>Match 4</strong> – BLAH BLAH <br/> <strong>Match 5</strong> – BLAH BLAH <br/> <strong>Match 6</strong> – BLAH BLAH <br/> <strong>Match 7</strong> – BLAH BLAH <br/> <strong>Match 8</strong> – BLAH BLAH <br/> </p> Namely being I dont know how to any tips, advice, links ?? thanks Paul Link to comment https://forums.phpfreaks.com/topic/180394-regex-this/ Share on other sites More sharing options...
Mchl Posted November 5, 2009 Share Posted November 5, 2009 But what do you want to match? Link to comment https://forums.phpfreaks.com/topic/180394-regex-this/#findComment-951667 Share on other sites More sharing options...
Garethp Posted November 5, 2009 Share Posted November 5, 2009 Only because I'm bored. $This = '<p> <strong>10am</strong> <br/> <strong>Match 1</strong> – BLAH BLAH <br/> <strong>Match 2</strong> – BLAH BLAH <br/> <strong>Match 3</strong> – BLAH BLAH <br/> <strong>Match 4</strong> – BLAH BLAH <br/> <strong>Match 5</strong> – BLAH BLAH <br/> <strong>Match 6</strong> – BLAH BLAH <br/> <strong>Match 7</strong> – BLAH BLAH <br/> <strong>Match 8</strong> – BLAH BLAH <br/> </p>'; $This = preg_replace('~\s?</?p>\s?~i', '', $This); preg_match_all('~<stong>(.*?)</strong>\s- [\S]+\s<br/>\s~', $This, $M); print_r($M); Note that this is untested Link to comment https://forums.phpfreaks.com/topic/180394-regex-this/#findComment-951671 Share on other sites More sharing options...
ctcmedia Posted November 5, 2009 Author Share Posted November 5, 2009 Thanks for that It isnt working there is more to the page I am trying to get the whole lot but it is a webpage that I am scraping -> http://www.110sport.tv/MatchShedule.aspx trying to get all matches thanks Paul Link to comment https://forums.phpfreaks.com/topic/180394-regex-this/#findComment-951675 Share on other sites More sharing options...
ctcmedia Posted November 5, 2009 Author Share Posted November 5, 2009 actualy how would i parse everyline of an output (this might be in wrong category) its for the same output thanks Paul Link to comment https://forums.phpfreaks.com/topic/180394-regex-this/#findComment-951683 Share on other sites More sharing options...
.josh Posted November 6, 2009 Share Posted November 6, 2009 "It's not working because there is more to it than that." seriously? Link to comment https://forums.phpfreaks.com/topic/180394-regex-this/#findComment-952197 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.