Help with REGEX and PHP

i’m trying to make a very simple scraper, i cannot find the right regex to cut in a string everything what is between the tag <PRE> and <PRE>. i also need to recognize as good <PRE CLASS=“anything”>.

when i try this, it works fine but it cuts up to the end of the site:
‘/<PRE CLASS=“tiny”>(.*?)/’

but when i try:
‘/<PRE CLASS=“tiny”>(.*?)</PRE>/’

it doesn’t work.

I also need a REGEX that allows me to select <Table></table>, <div “anything”></div>.

thank you all!