I have a string as
ABC, CDE, [{"ab":"1","cv":"23"},{"ab":"1","cv":"2%3A1639251967619%2C%22v%22%3A1%7D"}]
I want to split to get array of length 3 two strings and 3rd string with json array as string
ABC
CDE
[{"ab":"1","cv":"23"},{"ab":"1","cv":"2%3A1639251967619%2C%22v%22%3A1%7D"}]
using JS
You can do it by using split method like this:
const str = 'ABC,CDE,[{"ab":"1","cv":"23"},{"ab":"1","cv":"2%3A1639251967619%2C%22v%22%3A1%7D"}]';
let value = str.replace(/\w,/g, (match) => match[0] + '#').split('#');
// if you want to convert 3rd item to a valid JS object you can parse it, else you can miss next line:
value[2] = JSON.parse(value[2]);
console.log(value)