const regex = /(?<=").+(?=")/gm;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('(?<=").+(?=")', 'gm')
const str = `href="https://imss91-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3A%2F%2Fcenturylink.na1.adobesign.com%2Fpublic%2Fesign%3Ftsid%3DCBFCIBAA3AAABLblqZhBnH-aa7sqykOcK27PtbXdtJ21a5jorYZXFoFlwN1HMlRMfrsjgSzpmLlJuRxnhPUR_9TCx5mtSqVMq3GOUc4Aw%26&umid=99FFF6C9-D44F-8E05-8958-2AB9CDA85C9D&auth=19120be9529b25014b618505cb01789c5433dae7-e5e1810cfabbcbf81e7d2124136d2ae10570948f"`;
// 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