Google-sheets – Google Sheets: REGEXEXTRACT Formula to remove characters not inside [brackets] but leave , commas

formulasgoogle sheetsregexregexextract

I'm trying to create a formula that uses either =REGEXEXTRACT or =REGEXREPLACE to remove all characters not inside [brackets] but leaving the ,,, commas where they are.

For example…

➜ Text to Regex:

Checkbox 1, Checkbox 2, Checkbox 3[checked], Checkbox 4[disabled]

✔ Expected Result:

, , checked, disabled

My broken formula so far is…

=REGEXEXTRACT (J2, "\[([A-Za-z]+)\]")

✖ Current Result:


Does anyone know the correct way to achieve this?


I created this Google Sheet to show the current work:

Best Answer