$re = '/\s*\[\'([^\']*)\',\s*\'([^\']*)\']/';
$str = 'images_and_thumbnails = [
[\'https://images-na.ssl-images-amazon.com/images/I/615JCt72MXL._UY575_.jpg\', \'https://images-na.ssl-images-amazon.com/images/I/41rExpVS75L._US40_.jpg\'],
[\'https://images-na.ssl-images-amazon.com/images/I/71Ss5tJW-4L._UY575_.jpg\', \'https://images-na.ssl-images-amazon.com/images/I/41RpAwvZJ5L._US40_.jpg\'],
[\'https://images-na.ssl-images-amazon.com/images/I/6157znz2BeL._UY575_.jpg\', \'https://images-na.ssl-images-amazon.com/images/I/41mSje9rDSL._US40_.jpg\'],
[\'https://images-na.ssl-images-amazon.com/images/I/815wlLde-gL._UY575_.jpg\', \'https://images-na.ssl-images-amazon.com/images/I/51jty5d4BpL._US40_.jpg\'],
[\'https://images-na.ssl-images-amazon.com/images/I/71D2gVlCUOL._UY575_.jpg\', \'https://images-na.ssl-images-amazon.com/images/I/41kCBJYI%2BCL._US40_.jpg\'],
[\'https://images-na.ssl-images-amazon.com/images/I/71EfsMWdx0L._UY575_.jpg\', \'https://images-na.ssl-images-amazon.com/images/I/41utl4%2B%2B%2BoL._US40_.jpg\'],
[\'https://images-na.ssl-images-amazon.com/images/I/61m4mFpIvVL._UY575_.jpg\', \'https://images-na.ssl-images-amazon.com/images/I/41S27BGn0UL._US40_.jpg\']
]';
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