title: Extracting a value from an HTML tag attribute in Java
body: <p>I have recently taken on a community challenge and I am trying to extract the value of the 'rel' tag in the following line:</p>
  
  <p><code>&lt;td&gt;&lt;a title='Visit Personal Stats Page for ijackk' href='personal.php?name=ijackk&amp;amp;clan=ph_chat_ftw' class='rsn' rel='ijackk' style='color: #FFFFFF;'&gt;ijackk&lt;/a&gt;&lt;/td&gt;</code></p>
  
  <p>The reason for this is the challenge requires me to extract the names of multiple users off of a memberlist (a list of peoples with attributes relating to their account).  I don't <em>HAVE</em> to use regular expressions but I feel that it would be the best.  I have seen the classic post of why regular expressions are bad but I have also seen posts saying using it for stuff similar to this isn't a bad thing.</p>
  
  <p>The following is what I have done thus far:</p>
  
  <pre><code>public class Parser {
  
  public static void main(String[] arguments) {
      new Parser().parse();
  }
  
  public void parse() {
      try {
          URL url = new URL("http://www.runehead.com/clans/ml.php?clan=ph_chat_ftw");
          BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(url.openStream()));
          String line;
          StringBuilder stringBuilder = new StringBuilder();
          while ((line = bufferedReader.readLine()) != null) {
              if (line.contains("Visit")) {
                  stringBuilder.append(line).append("\n");
                  System.out.println(line);
              }
          }
          Matcher matcher = Pattern.compile("\\?rel='([A-Za-z0-9_]*)'").matcher(stringBuilder.toString());
          while (matcher.find()) {
              System.out.println("matched: " + matcher.group(1));
          }
      } catch (MalformedURLException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  
  }
  </code></pre>
  
  <p>The output of what I have there is what I have provided above, except for every name.  The matcher does not find anything, though.  Could I get some help please?</p>