title: How to extract a number from string using regex in java
body: <p>I have tried using</p>
  
  <pre><code>title.substring(title.lastIndexOf("(") + 1, title.indexOf(")"));
  </code></pre>
  
  <p>I only want to extract year like 1899.</p>
  
  <p>It works well for string like "hadoop (1899)" but is throwing errors for string "hadoop(yarn)(1980)"</p>