title: shell split a string using variable delimiters
body: <p>My problem is quite simple but I do not manage to solve it:</p>
  
  <p>I have a string that looks like this:</p>
  
  <pre><code>-3445.51692 -7177.16664 -9945.11057
  </code></pre>
  
  <p>the tricky part is that there could be zero or more withe space between each number and the latter can be either negative or positive, meaning that the string could also be like:</p>
  
  <pre><code>-3445.51692-7177.16664  -9945.11057
  </code></pre>
  
  <p>or</p>
  
  <pre><code>-3445.51692 7177.16664-9945.11057
  </code></pre>
  
  <p>(in case of a positive value there is at least one white space that precedes)</p>
  
  <p>and I would like to split this string into three variables that contains each number, e.g.:</p>
  
  <pre><code>a=-3445.51692
  b=-7177.16664
  c=-9945.11057
  </code></pre>
  
  <p>Thus, I wanted to use something like</p>
  
  <pre><code>IFS=' -' read -a array &lt;&lt;&lt; "$string"
  </code></pre>
  
  <p>but I don't know how to specify "zero or more white space". And using "-" as a delimiter removes it from the final result, while I want to keep the sign.</p>
  
  <p>Any ideas ?</p>