I have this:
var str = A123B234C456;
I need to split it into comma-separated chunks to return something like this:
A,123,B,234,c,456
I thought a regular expression would be best for this, but I keep getting stuck. Essentially, I tried to do a string replace, but you cannot use a regular expression in the second argument.
I would love to keep it simple and clean and do something like this, but it does not work:
str = str.replace(/[\d]+/, ","+/[\d]+/);
But in the real world that would be too simple.
Is it possible?