Welcome Guest, Not a member yet? Register   Sign In
Regular Expression
#1

[eluser]nirbhab[/eluser]
Quote:&lt;object width="425" height="355"&gt;<param name="movie" value="http://www.youtube.com/v/SZPz8gaFaEE&hl=en"></param><param name="wmode" value="transparent"></param>&lt;embed src="http://www.youtube.com/v/SZPz8gaFaEE&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;

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.
#2

[eluser]xwero[/eluser]
/src="(.+?)" type/ should do it.
#3

[eluser]nirbhab[/eluser]
Its not working..returning a empty array()

Code:
$pattern = '/&lt;embed[^&gt;]+src[\\s=\'"]';
$pattern .= '+([^"\'>\\s]+)/is';
This one is working fine...but, is it right way to perform the task?
#4

[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/';




Theme © iAndrew 2016 - Forum software by © MyBB