$re = '/\'(.*?video\.mp4)\'/';
$str = 'p.setup({
autostart: true,
file: \'http://test.com/d/wfne46sgmeikmgi3mg4kfmdgsunj4/video.mp4\',
type: \'mp4\',
height: window.innerHeight,
image: \'//cdn.test.com/thumb/hjjjgef.jpg\',
startparam: \'start\',
width: window.innerWidth,
abouttext:\'Player\',
aboutlink: \'http://www.test.com/abc\',
logo: {
hide: true,
file: \'//cdn.test.com/images/logo.png\'
},
sharing: {
code: encodeURI(\'<iframe width="640" height="360" src="http://test.com/embed-fwahrhsrh.html" frameborder="0" scrolling="no" allowfullscreen></iframe>\'),
link: \'http://www.test.com/fwahrhsrh\'
},
});';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php