const regex = /(?<=")[^"]+?\.xml(?=")/g;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('(?<=")[^"]+?\\.xml(?=")', 'g')
const str = `[],"bitrate":0,"duration":0.0,"format":"JPEG","height"z614,"lanquage":"","width":1536,"assetTypeIds":
["http://data.media.theplatform.eu/media/data/AssetType/4480581423"],"assetTypes": xnfl AA' v x
["hero_1536x614"],"serverId"z"http://data.media.theplatform.eu/media/data/Server/4538437053","streamingUrl":"httpzllmena-imq-cdn-
lb.aws.playco.com/Sony/OUTLANDERYZO148028001/OUTLANDERY2014SOZEo01-1536x614-DHE.jpg","protectionScheme":""},
{"id"z"http://data.media.theplatform.eu/media/data/MediaFile/114391621220","downloadUrl":"","releases":
[],"bitrate":0,"duration":0.0,"format":"JPEG","height"z324,"lanquage":"","width":S76,"assetTypeIds":["http://data.media.theplatform.eulmedia/data/AssetType/7849541325"],"assetTypes":
["dsk_tab_screenshot_576x324"1,"serverId":"http://data.media.theplatform.eu/media/data/Server/4S38437053","streamingUrl":"http://mena-img-cdn-
lb.aws.playco.com/Sony/OUTLANDERYZO148028001/OUTLANDERY2014SOZEo01-576x324-LSD.jpg","protectionScheme":""},
{"id"z"http://data.media.theplatform.eu/media/data/MediaFile/117352517052","downloadUrl":"","releases":
[],"bitrate":0,"duration":0.0,"format":"JPEG","height"z370,"lanquage":"","width"z250,"assetTypeIds":
["http://data.media.theplatform.eu/media/data/AssetType/14487621229"],"assetTypes":
["ooredoo_poster_25ox370_Proqram"],"serverId"z"http://data.media.theplatform.eu/media/data/Server/11680325311","streamingUrl":"http://distribution-
ooredoo.83.amazonaws.com/Sony/EPISODES/STZ_OUTLANDERY20148028001/STZ_OUTLANDERY20148028001_25ox370_PST.jpg","protectionScheme":""},
{"id"z"http://data.media.theplatform.eu/media/data/MediaFile/117352517066","downloadUrl":"","releases":
[],"bitrate":0,"duration":0.0,"format":"JPEG","height"z370,"lanquage":"","width"z250,"assetTypeIds":
["http://data.media.theplatform.eu/media/data/AssetType/14487621228"],"assetTypes":
["ooredoo_poster_25ox370_Season"],"serverId"z"http://data.media.theplatform.eu/media/data/Server/l1680325311","streamingUrl":"http://distribution-
ooredoo.83.amazonaws.com/Sony/SERIES/STZ_OUTLANDERY2014802/STZ_OUTLANDERY2014802_25ox370_PST.jpg","protectionScheme":""}]},{"ratings":
[],"mediaId":"http://data.media.theplatform.eu/media/data/Media/114389573291","mediaTitle":"Je Suis Prest","mediacuid"z"OUTLANDERY2014SOZEo09","availableDate":"2016-07-
01T10:4lz","content":[{"id"z"http://data.media.theplatform.eu/media/data/MediaFile/114391109180","downloadUrl":"","releases":
[{"pid":"chroPmeUeyk","url"z"http://link.theplatform.eu/s/anAph/chroPmeUeyk","restrictionld":""}],"bitrate":0,"duration":0.0,"format":"Filmstrip","height":110,"language":"en","wid
th":199,"assetTypeIds":["http://data.media.theplatform.eu/media/data/AssetType/5416517342"],"assetTypes":
["filmstrip_199x110"],"serverId"z"http://data.media.theplatform.eu/media/data/Server/4538437053","streamingUrl":"http://mena-img-cdn-
lb.aws.playco.com/Sony/OUTLANDERYZO148028009/OUTLANDERY2014SOZEo09.fs","protectionScheme":""},
{"id"z"http://data.media.theplatform.eu/media/data/MediaFile/114446917184","downloadUrl":"","releases":
[{"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,"
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":""},`;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
let m;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
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 JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions