JSFiddle - React, Tailwind, and code Playground
by Jussia
JavaScript
const regex = /(\w+)=(\d+)/gm;
const str = "Изменение шаблона {xTemplate:asyncTasksLayoutPF} печатной формы невозможно, так как он используется в задаче на выгрузку документа:{xTemplate:asyncTasksReportDelete}";
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++;
}
console.log('m', m)
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(match);
});
}