The .split() argument is the delimiter by which you want to split the string. If this regular expression contains comparable groups (indicated by parentheses), then they are also included in the result.
One way will be similar to what you have, but then filter out all blank lines.
ids.split(/([SE]\d+)/).filter(Boolean); // result: ["S1486", "S1485", "E444"]
If your target browsers don't have a .filter in the Array prototype, you will have to implement this for yourself, sorry. Alternatively, just get every second value from the result:
ids.split(/([SE]\d+)/) // result: ["", "S1486", "", "S1485", "", "E444", ""]
From there, a simple for loop can get you the parts you need.
source share