title: Matching unary signs and parsing math with Regex
body: <p>One last Regex problem I need help with. What I am trying to do is be able to parse a math expression, while still having my Regex recognize unary symbols. I am using the following to parse an integer:</p>
  
  <pre><code>[\+\-]?[0-9]+
  </code></pre>
  
  <p>Which works fine in these 2 scenarios:</p>
  
  <pre><code>myVar = -5
  myVar = +5
  </code></pre>
  
  <p>Regex correctly identifies both -5 and +5 as integers. My problem is if I have a scenario like this:</p>
  
  <pre><code>myVar = 7-5
  </code></pre>
  
  <p>This, however, gets matched correctly:</p>
  
  <pre><code>myVar = 7*-5
  </code></pre>
  
  <p>Now what Regex is doing in the 7-5 scenario is its identifying 2 integers, 7 and -5. In reality, what I want is for it to be able to identify an integer (7), a minus sign (-) and then another integer (5). What Regex pattern do I need to do this?</p>
  
  <p>Thanks in advance. This is .NET Regex, by the way.</p>