title: Splitting string with regular expression to make it array without empty element
body: <p>Here, I have example  javascipt string:</p>
  
  <pre><code>example_string = "Answer 1| Answer 2| Answer 3|";
  </code></pre>
  
  <p>I am trying to get array like this using regular expression:</p>
  
  <pre><code>Array ["Answer 1", " Answer 2", " Answer 3"]
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>result = example_string.split('/[|]+/g');
  </code></pre>
  
  <p>and also with the following patterns</p>
  
  <pre><code>'/[|]+/g'
  '/[|]+\b/g'
  '/[|]+[^$]/g'
  </code></pre>
  
  <p>And I am still getting an array with empty element at the end of it:</p>
  
  <pre><code> Array ["Answer 1", " Answer 2", " Answer 3", ""]
  </code></pre>
  
  <p>That cause me lot of trouble. Does anyone know where I am making mistake in my pattern or how to fix it?</p>