const regex = new RegExp('\\*e UserInterface Extensions Event (Pressed|Released|Clicked|Changed) Signal: (\\"(.*)\\")', 'g')
const str = `*e UserInterface Extensions Event Changed Signal: "togglebutton:on"
*e UserInterface Extensions Event Changed Signal: "togglebutton:off"
*e UserInterface Extensions Event Pressed Signal: "slider"
*e UserInterface Extensions Event Changed Signal: "slider:32"
*e UserInterface Extensions Event Changed Signal: "slider:68"
*e UserInterface Extensions Event Released Signal: "slider:68"
*e UserInterface Extensions Event Pressed Signal: "spinner:decrement"
*e UserInterface Extensions Event Released Signal: "spinner:decrement"
*e UserInterface Extensions Event Clicked Signal: "spinner:decrement"
*e UserInterface Extensions Event Pressed Signal: "button"
*e UserInterface Extensions Event Released Signal: "button"
*e UserInterface Extensions Event Clicked Signal: "button"
*e UserInterface Extensions Event Pressed Signal: "symbol"
*e UserInterface Extensions Event Released Signal: "symbol"
*e UserInterface Extensions Event Clicked Signal: "symbol"`;
// 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