title: How to split string using regex to split between +,-,*,/ symbols?
body: <p>I need to tell Ruby in regex to <code>split</code> before and after the <code>+ - * /</code> symbols in my program. </p>
  
  <p><strong>Examples:</strong></p>
  
  <p>I need to turn <code>"1+12"</code> into <code>[1.0, "+", 12.0]</code> </p>
  
  <p>and <code>"6/0.25"</code> into <code>[6.0, "/", 0.25]</code>   </p>
  
  <p>There could be cases like <code>"3/0.125"</code> but highly unlikely. If first two I listed above are satisfied it should be good.</p>
  
  <p>On the Ruby docs, <code>"hi mom".split(%r{\s*}) #=&gt; ["h", "i", "m", "o", "m"]</code></p>
  
  <p>I looked up a <a href="https://www.cheatography.com/davechild/cheat-sheets/regular-expressions/" rel="nofollow">cheat-sheet</a> to try to understand <code>%r{\s*}</code>, and I know that the stuff inside <code>%r{}</code> such as <code>\s</code> are skipped and \s means white space in regex.</p>