# PHP Help with Expressions and html TAg

**URL:** <https://forum.kirupa.com/t/php-help-with-expressions-and-html-tag/248649>\
**Category:** programming\
**Created:** [January 10, 2008, 1:23pm UTC](https://forum.kirupa.com/t/php-help-with-expressions-and-html-tag/248649 "2008-01-10T13:23:12Z")\
**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 10, 2008, 1:23pm UTC](https://forum.kirupa.com/t/php-help-with-expressions-and-html-tag/248649/1 "2008-01-10T13:23:12Z")

</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!
