title: How do I split a string in regex by a single S or E char followed by digits in JavaScript?
body: <p>I have a string like the following.</p>
  
  <pre><code>ids = 'S1486S1485E444'
  </code></pre>
  
  <p>I want to split it into an array of parts separated by the S or E like the following.</p>
  
  <pre><code>["S1486", "S1485", "E444"]
  </code></pre>
  
  <p>This is what I came up with but it gives the undefined and empty strings as well.</p>
  
  <pre><code>ids.split(/(S+\d+)|(E+\d+)/)
  
  ["", "S1486", undefined, "", "S1485", undefined, "", undefined, "E444", ""]
  </code></pre>