redneonrt Posted March 21, 2008 Share Posted March 21, 2008 I am having trouble with preg_match, it probably stems from my lack of knowledge about regular expressions. If someone could help me out I would really appreciate it. <h5>Plot Outline:</h5> 23rd century soldier Major Mitch Hunter (Jane) leads a fight against an army of underworld NecroMutants. </div> I would like to search for the whole string, how do I make an expression that would let the part highlighted in blue be anything? Hope that makes sense. Thanks, Chris Quote Link to comment Share on other sites More sharing options...
effigy Posted March 21, 2008 Share Posted March 21, 2008 <pre> <?php $str = ' <h5>Plot Outline:</h5> 23rd century soldier Major Mitch Hunter (Jane) leads a fight against an army of underworld NecroMutants. </div> '; preg_match('%<h5>Plot Outline:</h5>(.*?)</div>%s', $str, $matches); print_r($matches); ?> </pre> Quote Link to comment Share on other sites More sharing options...
redneonrt Posted March 21, 2008 Author Share Posted March 21, 2008 Thank you very much! Can you recommend a good read to learn more about php reg expressions? Quote Link to comment Share on other sites More sharing options...
effigy Posted March 21, 2008 Share Posted March 21, 2008 See the resources. This may be the best. Quote Link to comment Share on other sites More sharing options...
devreflex2004 Posted March 22, 2008 Share Posted March 22, 2008 Hi effigy, Your answers are simply great and help full. Thanks a loooooooooooooot. 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.