title: Regex to extract hyperlink containing a specific word
body: <p>I need to extract a hyperlink, containing a specific word in the url, from a piece of text. Example;</p>
  
  <p>"This is a text with a link to some page. Click this link <code>&lt;a href="/server/specificword.htm&gt;this is a link to a page&lt;/a&gt;</code> to see that page. Here is a link that doesn't have the word "specificword" in it: <code>&lt;a href="/server/mypage.htm&gt;this is a link without the word "specificword" in the url&lt;/a&gt;</code>"</p>
  
  <p>So, I need to parse this text, check the hyperlinks to see if one of them contains the word "specificword", and then extract the entire hyperlink. I would then end up with this:</p>
  
  <pre><code>&lt;a href="/server/specificword.htm&gt;this is a link to a page&lt;/a&gt;
  </code></pre>
  
  <p>I need the hyperlink that has specificword in the url eg. /server/specificword.htm, not in the link text</p>
  
  <p>One regex I have tried, is this one: <code>/(&lt;a[^&gt;]*&gt;.*?&lt;/a&gt;)|specificword/</code>
  This will match all hyperlinks in the text, or "specificword". If the text has multiple links, without the word "specificword", I will get those too.</p>
  
  <p>Also, I have tried this one, but it matces nothing:</p>
  
  <pre><code>&lt;a.*?href\s*=\s*["\']([^"\'&gt;]*specificword[^"\'&gt;]*)["\'][^&gt;]*&gt;.*?&lt;\/a&gt;
  </code></pre>
  
  <p>My regex skills end here, any help would be great....</p>