title: Best way in Java to find the first part of a string excluding certain characters
body: <p>What's the best way in Java to find the first part of a string excluding certain characters. For info, the only common element is the first [. The numbers after that, before the next ] are of variable length.</p>
  
  <p>Example input strings:</p>
  
  <pre><code>john[43] was
  Dave[0] had
  Sally[241] used
  </code></pre>
  
  <p>Required output strings:</p>
  
  <pre><code>john
  Dave
  Sally
  </code></pre>