const regex = /Project\(\"\{[\w-]+\}\"\)\s*=\s*\"(\w+)\"[,\s]+\"([^\"]+\.vcxproj)\"[,\s]+\"(\{[\w-]+\})\"/;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('Project\\(\\"\\{[\\w-]+\\}\\"\\)\\s*=\\s*\\"(\\w+)\\"[,\\s]+\\"([^\\"]+\\.vcxproj)\\"[,\\s]+\\"(\\{[\\w-]+\\})\\"', '')
const str = `Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApplication1", "ConsoleApplication1\\ConsoleApplication1.vcxproj", "{3136B732-9CB7-4B25-8CEA-3DCCD0634A6C}"`;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
let m;
if ((m = regex.exec(str)) !== null) {
// 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