Search code examples
regexnotepad++replace

notepad++ regex - remove brackets and separate values


I have list:

(1, 'Apple', '["5","8"]'),
...
(22, 'Mango', '["5","8"]'),
(23, 'Orange', '["5","8"]'),
(24, 'Banana', '["2","0"]'),
(25, 'Milk', '["2","0"]'),
...
(749, 'Bread', '["2","10"]'),

and I want to separate values in brackets like this

(1, 'Apple', '5', '8'),
...
(22, 'Mango', '5', '8'),
(23, 'Orange', '5', '8'),
(24, 'Banana', '2', '0'),
(25, 'Milk', '2', "0'),
...
(749, 'Bread', '2','10'),

Using Notepad++ "replace with" function. I am open also to another solutions.

Thank you


Solution

  • Regex replace all instances of:

    '\["(.*?)","(.*?)"\]'
    

    With:

    '\1','\2'