I try to wrap all tables inside my content with a special div container, to make them usable for mobile.
I can't wrap the tables, before they are saved within the database of the custom CSS. I managed to get to the content, before it's printed on the page and I need to preg_replace
all the tables there.
I do this, to get all tables:
preg_match_all('/(<table[^>]*>(?:.|\n)*<\/table>)/', $aFile['sContent'], $aMatches);
The problem is to get the inner part (?:.|\n)*
to match everything that is inside the tags, without matching the ending tag. Right now the expression matches everything, even the ending tag of the table...
Is there a way to exclude the match for the ending tag?