Tip! Create spaces after each "R, G, B" NOT "R,G,B"
RegEx Example w/ RGB Converter
How To Copy Formulas
- Click inside cell
- Click out (cell should be blue)
Β
- Copy + Paste where desired
Β
Tips With RegEx (Separating 3 Values In One Cell)
Remove
Remove First Number
replace(prop("RGB"), "[^,]*, ", "")
Remove Middle Number
replace(prop("RGB"), ",[^,]*", "")
Remove Last Number
replace(prop("RGB"), ",[^,]*$", "")
Isolate
Isolate First Number
replaceAll(replace(prop("RGB"), "(?:[^,]*, ){0}", ""), ",.*", "")
Isolate Second Number
replaceAll(replace(prop("RGB"), "(?:[^,]*, ){1}", ""), ",.*", "")
Isolate Third Number
replaceAll(replace(prop("RGB"), "(?:[^,]*, ){2}", ""), ",.*", "")
Calculate
Convert to HEX
"#" + replace(replace(replace(replace(replace(replace(format(floor(toNumber(replace(replace(prop("RGB"), ",[^,]*", ""), ",[^,]*$", "")) / 16)), "10", "A"), "11", "B"), "12", "C"), "13", "D"), "14", "E"), "15", "F") + replace(replace(replace(replace(replace(replace(format(toNumber(replace(replace(prop("RGB"), ",[^,]*", ""), ",[^,]*$", "")) / 16 % 1 * 16), "10", "A"), "11", "B"), "12", "C"), "13", "D"), "14", "E"), "15", "F") + replace(replace(replace(replace(replace(replace(format(floor(toNumber(replace(replace(prop("RGB"), "[^,]*, ", ""), ",[^,]*$", "")) / 16)), "10", "A"), "11", "B"), "12", "C"), "13", "D"), "14", "E"), "15", "F") + replace(replace(replace(replace(replace(replace(format(toNumber(replace(replace(prop("RGB"), "[^,]*, ", ""), ",[^,]*$", "")) / 16 % 1 * 16), "10", "A"), "11", "B"), "12", "C"), "13", "D"), "14", "E"), "15", "F") + replace(replace(replace(replace(replace(replace(format(floor(toNumber(replace(replace(prop("RGB"), "[^,]*, ", ""), "[^,]*, ", "")) / 16)), "10", "A"), "11", "B"), "12", "C"), "13", "D"), "14", "E"), "15", "F") + replace(replace(replace(replace(replace(replace(format(toNumber(replace(replace(prop("RGB"), "[^,]*, ", ""), "[^,]*, ", "")) / 16 % 1 * 16), "10", "A"), "11", "B"), "12", "C"), "13", "D"), "14", "E"), "15", "F")
Convert to RGB
format(toNumber(replace(replace(replace(replace(replace(replace(slice(replace(prop("HEX"), "#", ""), 0, 1), "A", "10"), "B", "11"), "C", "12"), "D", "13"), "E", "14"), "F", "15")) * 16 + toNumber(replace(replace(replace(replace(replace(replace(slice(replace(prop("HEX"), "#", ""), 1, 2), "A", "10"), "B", "11"), "C", "12"), "D", "13"), "E", "14"), "F", "15"))) + ", " + format(toNumber(replace(replace(replace(replace(replace(replace(slice(replace(prop("HEX"), "#", ""), 2, 3), "A", "10"), "B", "11"), "C", "12"), "D", "13"), "E", "14"), "F", "15")) * 16 + toNumber(replace(replace(replace(replace(replace(replace(slice(replace(prop("HEX"), "#", ""), 3, 4), "A", "10"), "B", "11"), "C", "12"), "D", "13"), "E", "14"), "F", "15"))) + ", " + format(toNumber(replace(replace(replace(replace(replace(replace(slice(replace(prop("HEX"), "#", ""), 4, 5), "A", "10"), "B", "11"), "C", "12"), "D", "13"), "E", "14"), "F", "15")) * 16 + toNumber(replace(replace(replace(replace(replace(replace(slice(replace(prop("HEX"), "#", ""), 5, 6), "A", "10"), "B", "11"), "C", "12"), "D", "13"), "E", "14"), "F", "15")))