const regex = /"28": (true|false)/gm;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('"28": (true|false)', 'gm')
const str = `{"1": true, "2": true, "3": true, "4": true, "5": true, "6": true, "7": true, "8": true, "9": true, "10": true, "11": true, "12": true, "13": true, "14": true, "15": true, "16": true, "17": true, "18": false, "19": false, "20": false, "21": false, "22": false, "23": false, "26": false, "27": false, "28": false, "29": false, "30": false, "31": false, "32": false, "33": false, "34": true, "35": true, "36": false, "37": true, "38": true, "39": false, "40": false, "41": false, "42": false, "81": false, "82": false}`;
// 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