title: Parse sentence with php preg_replace_callback and ignore data inside parenthesis
body: <p>I have this string,</p>
  
  <blockquote>
    <p>A large hoofed mammal (Equus caballus) having a short-haired coat, a
    long mane, and a long tail, domesticated since ancient times and used
    for riding and for drawing or carrying loads.</p>
  </blockquote>
  
  <p>which needs to be converted into this:</p>
  
  <p><strong>A <a href="http://words.com/large" rel="nofollow">large</a> <a href="http://words.com/hoofed" rel="nofollow">hoofed</a> <a href="http://words.com/mammal" rel="nofollow">mammal</a> (Equus caballus) <a href="http://words.com/having" rel="nofollow">having</a> a <a href="http://words.com/short" rel="nofollow">short</a>-<a href="http://words.com/haired" rel="nofollow">haired</a> coat, a long mane, and a long tail, <a href="http://words.com/domesticated" rel="nofollow">domesticated</a> <a href="http://words.com/since" rel="nofollow">since</a> <a href="http://words.com/ancient" rel="nofollow">ancient</a> <a href="http://words.com/times" rel="nofollow">times</a> and used for <a href="http://words.com/riding" rel="nofollow">riding</a> and for <a href="http://words.com/drawing" rel="nofollow">drawing</a> or <a href="http://words.com/carrying" rel="nofollow">carrying</a> <a href="http://words.com/loads" rel="nofollow">loads</a>.</strong></p>
  
  <p>These are the requirements:</p>
  
  <ol>
  <li>words with a length of 5+ have to be encapsulated inside an a href tag. <em>(this is already solved)</em></li>
  <li>words inside parenthesis have to be ignored. <strong>This is the missing requirement in the regex</strong></li>
  </ol>
  
  <p>Currently, the code below is converting the original string into this (data inside parenthesis is not being ignored as it should be):</p>
  
  <p><strong>A <a href="http://words.com/large" rel="nofollow">large</a> <a href="http://words.com/hoofed" rel="nofollow">hoofed</a> <a href="http://words.com/mammal" rel="nofollow">mammal</a> (<a href="http://words.com/equus" rel="nofollow">Equus</a> <a href="http://words.com/caballus" rel="nofollow">caballus</a>) <a href="http://words.com/having" rel="nofollow">having</a> a <a href="http://words.com/short" rel="nofollow">short</a>-<a href="http://words.com/haired" rel="nofollow">haired</a> coat, a long mane, and a long tail, <a href="http://words.com/domesticated" rel="nofollow">domesticated</a> <a href="http://words.com/since" rel="nofollow">since</a> <a href="http://words.com/ancient" rel="nofollow">ancient</a> <a href="http://words.com/times" rel="nofollow">times</a> and used for <a href="http://words.com/riding" rel="nofollow">riding</a> and for <a href="http://words.com/drawing" rel="nofollow">drawing</a> or <a href="http://words.com/carrying" rel="nofollow">carrying</a> <a href="http://words.com/loads" rel="nofollow">loads</a>.</strong></p>
  
  <p>This is my current code:</p>
  
  <pre><code>$result = preg_replace_callback('/\b[\p{L}\p{M}]{5,}\b/u', create_function(
      '$matches',
      'return "&lt;a href=\"http://words.com/".strtolower($matches[0])."\"&gt;$matches[0]&lt;/a&gt;";'
  ), $data);
  </code></pre>
  
  <p>How can I implement the 2nd requirement in the same regex?
  Thanks!</p>