title: Regular expression remove dash character
body: <p>I have a text input that will be input like the following</p>
  
  <pre><code>7 - BMW 550i
  </code></pre>
  
  <p>If the user inputs this, how can i use a regular expression to remove all the content on the right of the dash character so all i am left with is the first numerical value.</p>
  
  <p>I have tried this:</p>
  
  <pre><code>-?\\d+
  </code></pre>
  
  <p>But if like the example i gave it will get the end numbers.</p>