title: PHP: Warning: preg_match() [function.preg-match]: Unknown modifier '.' in
body: <p>I'm aware there are similar questions and I have looked at a few of them however even with that knowledge I haven't been able to solve my own problem. I would greatly appreciate it if anyone could point out the problem to me!</p>
  
  <pre><code>function getCategories($source)
  {
      $pattern = "&lt;span class=\".*\" id=\".*\"&gt;.*&lt;.span&gt;.*&lt;table class=\".*\".*&gt;
  &lt;tr&gt;
  &lt;th.*
  &lt;.th&gt;
  &lt;th.*
  &lt;.th&gt;
  &lt;th.*
  &lt;.th&gt;
  &lt;th.*
  &lt;.th&gt;
  &lt;th.*
  &lt;.th&gt;
  &lt;th.*
  &lt;.th&gt;&lt;.tr&gt;
  (&lt;tr id=\".*\"&gt;\n(.*\n){6}&lt;.td&gt;&lt;.tr&gt;(&lt;.table&gt;)?\n)*";
  
      preg_match($pattern, $source, $categories);
  
      return $categories;
  }
  </code></pre>
  
  <p>With the error message:</p>
  
  <pre><code>Warning: preg_match() [function.preg-match]: Unknown modifier '.' in /home/a1464157/public_html/functions.php on line 31
  </code></pre>
  
  <p>Line 31 is "preg_match(...)".</p>
  
  <p>I am sure the regex should work as I have tested it in a tool, and the correct string is definitely being passed through, it just doesn't like my reg. expression for some reason. I've tried to make sure everything was either escaped or replaced with a . (last resort when escaping the / didn't work).</p>
  
  <p>Any assistance would be greatly appreciated! Thank you!</p>
  
  <p>~Andrew</p>