I try to capture and replace strings with regex in notepad++, but the result is not as expected. The database is formatted like this:
(602, '0602', '[{"id":"9","value":""},{"id":"1","value":"1"}]'),
(1644, '0164', '[{"id":"9","value":""},{"id":"1","value":"3"}]'),
(1311, '0131', '[{"id":"9","value":""},{"id":"1","value":"100"}]'),
(1321, '0132', '[{"id":"9","value":""},{"id":"1","value":"150"}]')
The task is to capture and place column 2 (values 0602, 0164, 0131, 0131) and to insert it as value of id 9. For example, end result must be like this:
(602, '0602', '[{"id":"9","value":"0602"},{"id":"1","value":"1"}]'),
(1644, '0164', '[{"id":"9","value":"0164"},{"id":"1","value":"3"}]'),
(1311, '0131', '[{"id":"9","value":"0131"},{"id":"1","value":"100"}]'),
(1321, '0132', '[{"id":"9","value":"0132"},{"id":"1","value":"150"}]')
I try with this regex in Notepad++ - Search:
(, '.*)("id":"9","value":"")
Replace:
($1)("id":"9","value":"$1")
The result is close, but not what I need. Please, help me if you know the right answer. Thank you in advance.