import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "(?<=\")[^\"]+?\\.xml(?=\")";
final String string = "[],\"bitrate\":0,\"duration\":0.0,\"format\":\"JPEG\",\"height\"z614,\"lanquage\":\"\",\"width\":1536,\"assetTypeIds\":\n"
+ "[\"http://data.media.theplatform.eu/media/data/AssetType/4480581423\"],\"assetTypes\": xnfl AA' v x\n"
+ "[\"hero_1536x614\"],\"serverId\"z\"http://data.media.theplatform.eu/media/data/Server/4538437053\",\"streamingUrl\":\"httpzllmena-imq-cdn-\n"
+ "lb.aws.playco.com/Sony/OUTLANDERYZO148028001/OUTLANDERY2014SOZEo01-1536x614-DHE.jpg\",\"protectionScheme\":\"\"},\n"
+ "{\"id\"z\"http://data.media.theplatform.eu/media/data/MediaFile/114391621220\",\"downloadUrl\":\"\",\"releases\":\n"
+ "[],\"bitrate\":0,\"duration\":0.0,\"format\":\"JPEG\",\"height\"z324,\"lanquage\":\"\",\"width\":S76,\"assetTypeIds\":[\"http://data.media.theplatform.eulmedia/data/AssetType/7849541325\"],\"assetTypes\":\n"
+ "[\"dsk_tab_screenshot_576x324\"1,\"serverId\":\"http://data.media.theplatform.eu/media/data/Server/4S38437053\",\"streamingUrl\":\"http://mena-img-cdn-\n"
+ "lb.aws.playco.com/Sony/OUTLANDERYZO148028001/OUTLANDERY2014SOZEo01-576x324-LSD.jpg\",\"protectionScheme\":\"\"},\n"
+ "{\"id\"z\"http://data.media.theplatform.eu/media/data/MediaFile/117352517052\",\"downloadUrl\":\"\",\"releases\":\n"
+ "[],\"bitrate\":0,\"duration\":0.0,\"format\":\"JPEG\",\"height\"z370,\"lanquage\":\"\",\"width\"z250,\"assetTypeIds\":\n"
+ "[\"http://data.media.theplatform.eu/media/data/AssetType/14487621229\"],\"assetTypes\":\n"
+ "[\"ooredoo_poster_25ox370_Proqram\"],\"serverId\"z\"http://data.media.theplatform.eu/media/data/Server/11680325311\",\"streamingUrl\":\"http://distribution-\n"
+ "ooredoo.83.amazonaws.com/Sony/EPISODES/STZ_OUTLANDERY20148028001/STZ_OUTLANDERY20148028001_25ox370_PST.jpg\",\"protectionScheme\":\"\"},\n"
+ "{\"id\"z\"http://data.media.theplatform.eu/media/data/MediaFile/117352517066\",\"downloadUrl\":\"\",\"releases\":\n"
+ "[],\"bitrate\":0,\"duration\":0.0,\"format\":\"JPEG\",\"height\"z370,\"lanquage\":\"\",\"width\"z250,\"assetTypeIds\":\n"
+ "[\"http://data.media.theplatform.eu/media/data/AssetType/14487621228\"],\"assetTypes\":\n"
+ "[\"ooredoo_poster_25ox370_Season\"],\"serverId\"z\"http://data.media.theplatform.eu/media/data/Server/l1680325311\",\"streamingUrl\":\"http://distribution-\n"
+ "ooredoo.83.amazonaws.com/Sony/SERIES/STZ_OUTLANDERY2014802/STZ_OUTLANDERY2014802_25ox370_PST.jpg\",\"protectionScheme\":\"\"}]},{\"ratings\":\n"
+ "[],\"mediaId\":\"http://data.media.theplatform.eu/media/data/Media/114389573291\",\"mediaTitle\":\"Je Suis Prest\",\"mediacuid\"z\"OUTLANDERY2014SOZEo09\",\"availableDate\":\"2016-07-\n"
+ "01T10:4lz\",\"content\":[{\"id\"z\"http://data.media.theplatform.eu/media/data/MediaFile/114391109180\",\"downloadUrl\":\"\",\"releases\":\n"
+ "[{\"pid\":\"chroPmeUeyk\",\"url\"z\"http://link.theplatform.eu/s/anAph/chroPmeUeyk\",\"restrictionld\":\"\"}],\"bitrate\":0,\"duration\":0.0,\"format\":\"Filmstrip\",\"height\":110,\"language\":\"en\",\"wid\n"
+ "th\":199,\"assetTypeIds\":[\"http://data.media.theplatform.eu/media/data/AssetType/5416517342\"],\"assetTypes\":\n"
+ "[\"filmstrip_199x110\"],\"serverId\"z\"http://data.media.theplatform.eu/media/data/Server/4538437053\",\"streamingUrl\":\"http://mena-img-cdn-\n"
+ "lb.aws.playco.com/Sony/OUTLANDERYZO148028009/OUTLANDERY2014SOZEo09.fs\",\"protectionScheme\":\"\"},\n"
+ "{\"id\"z\"http://data.media.theplatform.eu/media/data/MediaFile/114446917184\",\"downloadUrl\":\"\",\"releases\":\n"
+ "[{\"pid\":\"9pryBMkmeo\",\"url\"z\"http://link.theplatform.eu/s/anAph/QpryBMkmeo\",\"restrictionld\":\"\"}],\"bitrate\":0,\"duration\":0.0,\"format\":\"DFXP\",\"height\":0,\"lanquage\":\"ar\",\"width\":0,\"\n"
+ "assetTypeIds\"z[\"http://data.media.theplatform.eu/media/data/AssetType/23575621096\"],\"assetTypes\"z[\"dfxp_ar_vu\"1,\"serverId\":\"\",\"streamingUrl\":\"http://mena-jit-cdn-lb.aws.playco.com/JIT/sony/OUTLANDERY2014S02E009/DRM/942f9636aea1289badf655d9f340cc65936e4660/OUTLANDERY2014S02E009.xml\" , \"protectionScheme\":\"\"},";
final Pattern pattern = Pattern.compile(regex);
final Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
System.out.println("Full match: " + matcher.group(0));
for (int i = 1; i <= matcher.groupCount(); i++) {
System.out.println("Group " + i + ": " + matcher.group(i));
}
}
}
}
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 Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html