sameer1122 Posted May 4, 2007 Share Posted May 4, 2007 I have a string - http://www.youtube.com/watch?v=xxxxxxxxxxx Can somebody help me with the code to retrive xxxxxxxxxxx from the string I tried $pattern = '/youtube\]http://(?:www\.)?youtube.com/watch\?v=([0-9A-Za-z-_]{11})[^[]*\[/youtube\]/s'; preg_match_all($pattern,$text,$matches); But it doesnt work and gives the error - preg_match_all() [function.preg-match-all]: Unknown modifier '/' Thanking you Sameer Link to comment https://forums.phpfreaks.com/topic/50011-solved-request-help-on-preg_match_all/ Share on other sites More sharing options...
effigy Posted May 4, 2007 Share Posted May 4, 2007 <pre> <?php $string = '[youtube]http://www.youtube.com/watch?v=xxxxxxxxxxx[/youtube]'; preg_match_all('%(?<==)(.+?)(?=\[/youtube\])%', $string, $matches); print_r($matches); ?> </pre> Link to comment https://forums.phpfreaks.com/topic/50011-solved-request-help-on-preg_match_all/#findComment-245512 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.