title: Using regex to extract numbers and symbols from string
body: <p>I have a string with text, numbers, and symbols. I'm trying to extract the numbers, and symbols from the string with limited success. Instead of getting the entire number and symbols, I'm only getting part of it. I will explain my regex below, to make it more clearer, and easier to understand.</p>
  
  <pre><code>\d : any number
  [+,-,*,/,0-9]+ : 1 or more of any +,-,*,/, or number
  \d : any number
  </code></pre>
  
  <p><b> Code: </b></p>
  
  <pre><code>$string = "text 1+1-1*1/1= text";
  
  $regex = "~\d[+,-,*,/,0-9]+\d~siU";
  preg_match_all($regex, $string, $matches); 
  
  echo $matches[0][0];
  </code></pre>
  
  <p><b> Expected Results </b></p>
  
  <pre><code>1+1-1*1/1
  </code></pre>
  
  <p><b> Actual Results </b></p>
  
  <pre><code>1+1
  </code></pre>