title: Using Regular Expressions to Extract a Value in Java
body: <p>I have several strings in the rough form:</p>
  
  <pre><code>[some text] [some number] [some more text]
  </code></pre>
  
  <p>I want to extract the text in [some number] using the Java Regex classes.</p>
  
  <p>I know roughly what regular expression I want to use (though all suggestions are welcome). What I'm really interested in are the Java calls to take the regex string and use it on the source data to produce the value of [some number].</p>
  
  <p>EDIT: I should add that I'm only interested in a single [some number] (basically, the first instance). The source strings are short and I'm not going to be looking for multiple occurrences of [some number].</p>