Hello,
I am pulling info from one of my websites using regular expressions. I am in the process of teaching myself regex but I am confused about something. In a certain sections I want to detect if it is in caps or not. For example this works:
But when I try to detect if title is TITLE with an or parameter it does not work:
I have tried to use parenthesis but that does not help either. What am I doing wrong?
Thanks
I am pulling info from one of my websites using regular expressions. I am in the process of teaching myself regex but I am confused about something. In a certain sections I want to detect if it is in caps or not. For example this works:
Code:
preg_match('~<title>(.*?)</title>~i', file_get_contents('[URL unfurl="true"]http://www.awebsite.com'),[/URL] $TheTitle );
echo "The Title is $TheTitle[1]";
But when I try to detect if title is TITLE with an or parameter it does not work:
Code:
preg_match('~<title|TITLE>(.*?)</title|TITLE>~i', file_get_contents('[URL unfurl="true"]http://www.awebsite.com'),[/URL] $TheTitle );
echo "The Title is $TheTitle[1]";
I have tried to use parenthesis but that does not help either. What am I doing wrong?
Thanks