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 Link to comment https://forums.phpfreaks.com/topic/97249-preg_match-help/ 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> Link to comment https://forums.phpfreaks.com/topic/97249-preg_match-help/#findComment-497627 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? Link to comment https://forums.phpfreaks.com/topic/97249-preg_match-help/#findComment-497640 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. Link to comment https://forums.phpfreaks.com/topic/97249-preg_match-help/#findComment-497641 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. Link to comment https://forums.phpfreaks.com/topic/97249-preg_match-help/#findComment-498164 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.