title: Extract values from URls using regular expression
body: <p>I have the following <code>Pattern</code> </p>
  
  <pre><code>http://abc.com/#!/[0-9a-z]
  http://abc.com/#!/search/%23[^.]
  </code></pre>
  
  <p>So the first pattern identify the URL of a user and second URL identifies search parameters.</p>
  
  <p>I can check whether the pattern belongs to user or search query using <code>Pattern</code> and <code>Matcher</code> class in Java. How can i extract the values of user or search term?</p>