正規表現を使用して、前に特定の単語 (この場合は「スライド」と「タイトル」) があるテキストと一致させようとしています。後読みアサーションを使用して相互にネストしようとしましたが、機能していないようです。もう 1 つの問題は、一致させるために使用している「スライド」と「タイトル」の単語の間に別のテキストがあることです。
私はもう試した:
(?<=slide(?<=title\\s=\\s)).*(?=\\\")
(?<=title\\s=\\s(?<=slide)).*(?=\\\")
これを行う方法に関する提案はありますか?余分なスラッシュはエスケープ用です。私はこれをobjective-cで使用していますが、それが重要かどうかはわかりません。
より良いコンテキストのためにスクレイピングしている JSON の一部 (各スライドの「タイトル」の後にタイトルを取得しようとしています):
slide = {
createdAt = "2013-06-18T20:06:50Z";
description = "<p>Due to the amount of attention paid to each organization's top prospects and early-round draft picks, many of the game's underrated prospects are perpetually obscured. Most of the time, these prospects are younger players who are housed in the low minors and still require considerable physical projection. At the same time, there are countless prospects on the older side of the age curve who have dipped off the radar due to injury.</p><p>Here's a look at one \"hidden gem\" from each organization who could make a push for the major leagues in the coming years.</p>";
embedCode = "";
externalId = "<null>";
id = 3219926;
photoHasCropExact = 1;
photoHasCropNorth = 0;
primaryPhoto = {
url = "http://img.bleacherreport.net/img/slides/photos/003/219/926/hi-res-5382332_crop_north.jpg";
};
title = "Each MLB Team's 'Hidden Gem' Prospect Fans May Not Know About";
updatedAt = "2013-06-18T22:26:30Z";
url = "<null>";