ghurty Posted August 12, 2007 Share Posted August 12, 2007 What regex expression could I use to tell a script to ignore everything after a certain set phrase. I am trying to use: http://labs.echoditto.com/fulltextrss to pull an rss feed, he states there that you can use regex to trim the results. I want by a particular feed, for it not display anything in the article after the words "my website" Any suggestions how I would go about it? Thanks Quote Link to comment Share on other sites More sharing options...
MadTechie Posted August 13, 2007 Share Posted August 13, 2007 erm.. i maybe missing something but wouldn't this work ? $RSSFEED = " blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blar blarblar blar blar blar blar 12345 my website 567890blar blarblar blar blar blar blarblar blarblar blar blar blar blarblar blarblar blar blar blar blarblar blarblar blar blar blar blar "; if (preg_match('/(.*)my website/si', $RSSFEED, $regs)) { $result = $regs[1]; } echo $result; Quote Link to comment Share on other sites More sharing options...
ghurty Posted August 13, 2007 Author Share Posted August 13, 2007 The problem is that that i have to have it in the url itself Quote Link to comment Share on other sites More sharing options...
MadTechie Posted August 13, 2007 Share Posted August 13, 2007 i don't understand what you mean Quote Link to comment Share on other sites More sharing options...
ghurty Posted August 13, 2007 Author Share Posted August 13, 2007 Sorry about that, here is a an example from the site. feeds.feedburner.com/stereogum®ex0=/ <h3> class="title">.*<\/h3>/®ex1=/ <div class="posted".*$/smi I need something like this, but to strip off all text following "x" keyword Thanks Quote Link to comment Share on other sites More sharing options...
MadTechie Posted August 14, 2007 Share Posted August 14, 2007 can you post the sting you start with the string you wish to have after filtering it.. because i don't know what you mean by strip off all text following "x" keyword Quote Link to comment 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.