title: How to split numbers from a string in Java?
body: <p>I'm having problems thinking of a way to split numbers of string. What I have done already is split the string into multiple characters.</p>
  
  <p>so if the expression was <code>gi356f</code>
  it would give:</p>
  
  <pre><code>g
  i
  3
  5
  6
  f
  </code></pre>
  
  <p>But I want the 356 to be considered as a number in it's own respect. and the problem I'm dealing with consists of strings that look like <code>(345+3)*/3</code></p>
  
  <p>I tried looking at the current character in the string and the next, and tried checking whether it's a digit and if so, attached them but this led to many errors. for instance it would only handle two digit long numbers and also not so well, if the string was 43, it would use the 3 twice. (e.g once for 43 and again for 3 on it's on). Also if the expression at the end ended with a number of a given string if would be handled twice also.</p>
  
  <p>I'm not sure how to address this problem. I think maybe use regex or scanner but not sure how to go about it, even after looking at some code online of smaller examples.</p>