in addition to Mr. Pritaeas's response, this
$regex = '/TITLE>(.+?)TITLE/';
gives us the expected result.
Blank website. Blank site. Nothing to see here.</
Yes, this </ is included. So, it isn't really the same result as
$regex = '/<TITLE>(.+?)\<\/TITLE\>/';
which will give us
Blank website. Blank site. Nothing to see here.
One limitation of the regex code above is that, it will not give us anything if the title tag is written in lowercase as in html5 standard
$title = '<title>Blank website. Blank site. Nothing to see here.</title>';
to make our regex case-insensitive we can change the regex filter to
$regex = '/<title>(.*)<\/title>/i';
the above should return the title string from either
$title = '<title>Blank website. Blank site. Nothing to see here.</title>';
or
$title = '<TITLE>Blank website. Blank site. Nothing to see here.</TITLE>';
test:
if(preg_match('/<title>(.*)<\/title>/i',$title,$matches)){
echo $matches[1];
}
should return the title string from either of the title variables.