I need a split conditional to split by ;
Except IF the ; is after a < ou >. (< or > are converted in < or >
)
Example:
Input:
A > , < B , < C > ; 100, 119, 150
Output:
A >, < B, < C >
100,119,150
I can make it:
var myString = "A > , < B , < C > ; 100, 119, 150"
myString.replace(">", "!!!before").replace("<", "!!!after");
myString.split(";");
myString.replace("!!!before", ">").replace("!!!after", "<");
But this solution is a big workaround to my case, I'm searching a solution using regex or indexof to improve it.