tags:

views:

152

answers:

2

I have the following string for example:

abcba"c"bacba"fbaf"gdsfgafa"http://www.youtube.com/watch?v=0eLoApO7wrs"gsg

How can I extract the youtube url from this string?

+1  A: 

How about this

\"http://www.youtube.com/watch\?.+\" 
Upul
Capture the URL in a parenthetic group: `"\"(http://www.youtube.com/watch\?.+)\""`
Amarghosh
+2  A: 
"\"(http:[^\"]*)\""
jspcal
This will catch all urls.
Callum Rogers
which is what he wants, read the example again
jspcal