$re = '/\\\\"(title|url)\\\\": \\\\"[^"]*\\\\"/m';
$str = '1. Есть строки в текстовом файле: "title": "разный текст"
Найти всё в этом файле.
2. Есть строки в текстовом файле:
"url": "разный текст"
Найти всё в этом файле.
3. Есть всё в общей строке в текстовом файле:
"title": "разный текст", "url": "разный текст"
[{"hostName": "youtube", "name": "Rock & Roll 50\'s Mix", "type": "VIDEO", "iconimage": "https://i.ytimg.com/vi/gLzn8nDVSo8/hq720.jpg?sqp=-...", "resolver": "youtube", "data": "{\\"category\\": \\"video\\", \\"name\\": \\"category\\", \\"title\\": \\"Rock & Roll 50\'s Mix\\", \\"url\\": \\"http://www.youtube.com/watch?v=gLzn8nDVSo8\\", \\"time\\": \\"9 \\\\u043b\\\\u0435\\\\u0442 \\\\u043d\\\\u0430\\\\u0437\\\\u0430\\\\u0434\\", \\"desc\\": \\"Duration: 11:38 | 71\\\\u00a0528\\\\u00a0835 \\\\u043f\\\\u0440\\\\u043e\\\\u0441\\\\u043c\\\\u043e\\\\u0442\\\\u0440\\\\u043e\\\\u0432 | 9 \\\\u043b\\\\u0435\\\\u0442 \\\\u043d\\\\u0430\\\\u0437\\\\u0430\\\\u0434\\\\ndjdirtybeat\\\\nPLEASE LIKE MY FACEBOOK PAGE, Download Here https://soundcloud.com/mauricio-villegas-12\\\\u00a0...\\", \\"type\\": \\"video\\", \\"icon\\": \\"https://i.ytimg.com/vi/gLzn8nDVSo8/hq720.jpg?sqp=-..."}", "description": "Duration: 11:38 | 71\\u00a0528\\u00a0835 \\u043f\\u0440\\u043e\\u0441\\u043c\\u043e\\u0442\\u0440\\u043e\\u0432 | 9 \\u043b\\u0435\\u0442 \\u043d\\u0430\\u0437\\u0430\\u0434\\ndjdirtybeat\\nPLEASE LIKE MY FACEBOOK PAGE, Download Here https://soundcloud.com/mauricio-villegas-12\\u00a0..."}, {"hostName": "youtube", "name": "Free - All Right Now", "type": "VIDEO", "iconimage": "https://i.ytimg.com/vi/YExuLkIaQ7U/hq720.jpg?sqp=-...", "resolver": "youtube", "data": "{\\"category\\": \\"video\\", \\"name\\": \\"category\\", \\"title\\": \\"Free - All Right Now\\", \\"url\\": \\"http://www.youtube.com/watch?v=YExuLkIaQ7U\\", \\"time\\": \\"11';
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