title: Get the content of the href attribute of an a element
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3820666/grabbing-the-href-attribute-of-an-a-element">Grabbing the href attribute of an A element</a>  </p>
  </blockquote>
  
  
  
  <p>Hello,</p>
  
  <p>I have the following html I want to parse:</p>
  
  <pre><code>&lt;td align="left" nowrap="nowrap"&gt;&lt;a href="XXXXXXX"&gt;
  </code></pre>
  
  <p>I want to save XXXXX on a variable.
  I know next to nothing of regular expressions. I know how to do it using strpos, substr, etc. But I believe it is slower than using regex.</p>
  
  <pre><code>if (preg_match('!&lt;td align="left" NOWRAP&gt;&lt;a href=".\s+/.+"&gt;!', $result, $matches))
      echo $matches[1];
  else
      echo "error!!!";
  </code></pre>
  
  <p>I know the previous code is an atrocity to a regex expert. But I really have no idea how to do it. I need <em>some</em> tips, not the full solution.</p>