![]() |
Regular Expression - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Regular Expression (/showthread.php?tid=7256) |
Regular Expression - El Forum - 04-01-2008 [eluser]nirbhab[/eluser] Quote:<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/SZPz8gaFaEE&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/SZPz8gaFaEE&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object> Guys how to find the bold string from the above string Hope you have got my idea. I want add the youtube videos in my site, added as user videos..some what like orkut does. I am going to extract the source of flash file, and save in DB_table with user_id(logged in user). If my plan is wrong please suggest a better way. Regular Expression - El Forum - 04-01-2008 [eluser]xwero[/eluser] /src="(.+?)" type/ should do it. Regular Expression - El Forum - 04-01-2008 [eluser]nirbhab[/eluser] Its not working..returning a empty array() Code: $pattern = '/<embed[^>]+src[\\s=\'"]'; Regular Expression - El Forum - 04-01-2008 [eluser]Pascal Kriete[/eluser] xwero has it right, but regular expression tester reveals that your snippet has funny quotes. So a cheap hack would be: Code: $patthern = '/src=[^a](.+?)[^a] type/'; |