# Help with REGEX and PHP

**URL:** <https://forum.kirupa.com/t/help-with-regex-and-php/249300>\
**Category:** programming\
**Created:** [January 17, 2008, 11:54am UTC](https://forum.kirupa.com/t/help-with-regex-and-php/249300 "2008-01-17T11:54:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dinchu37](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@dinchu37](https://forum.kirupa.com/u/dinchu37)\
**Post date:** [January 17, 2008, 11:54am UTC](https://forum.kirupa.com/t/help-with-regex-and-php/249300/1 "2008-01-17T11:54:14Z")

</div>

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!
