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!
function getCategories($source)
{
$pattern = "<span class=\".*\" id=\".*\">.*<.span>.*<table class=\".*\".*>
<tr>
<th.*
<.th>
<th.*
<.th>
<th.*
<.th>
<th.*
<.th>
<th.*
<.th>
<th.*
<.th><.tr>
(<tr id=\".*\">\n(.*\n){6}<.td><.tr>(<.table>)?\n)*";
preg_match($pattern, $source, $categories);
return $categories;
}
With the error message:
Warning: preg_match() [function.preg-match]: Unknown modifier '.' in /home/a1464157/public_html/functions.php on line 31
Line 31 is "preg_match(...)".
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).
Any assistance would be greatly appreciated! Thank you!
~Andrew