JSFiddle - React, Tailwind, and code Playground

by xonev

JavaScript

try {
    var color = 'rgb(255, 15, 120)';
    var matchColors = /rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/;
    var match = matchColors.exec(color);
    if (match !== null) {
        document.write('Red: ' + match[1] + ' Green: ' + match[2] + ' Blue: ' + match[3]);
    }

}
catch (e) {
    alert(e.message);
}