title: Regex java a regular expression to extract string except the last number
body: <p>How to extract all characters from a string without the last number (if exist ) in Java, I found how to extract the last number in a string using this regex <code>[0-9.]+$</code> , however I want the opposite.</p>
  
  <p>Examples :</p>
  
  <p><code>abd_12df1231</code> => <code>abd_12df</code></p>
  
  <p><code>abcd</code> => <code>abcd</code></p>
  
  <p><code>abcd12a</code> => <code>abcd12a</code></p>
  
  <p><code>abcd12a1</code> => <code>abcd12a</code></p>