$re = '/(?i)^(Where|How|Is|Does|I wanna|I want|I wish)\b.*\bdemo( game| version( of the game)?)?( exist| available| out there)?(\.|\?|!)*?$/m';
$str = 'How can I download the demo
Where get demo?!?!
where is the demo version of the game?
How do I get the demo game!
Anyone know how to get the demo?
How does one download a geneshit
so I was wondering, how do we get more newbies to play the demo
Does a demo version of the game exist?!?!?
Is a demo version of the game available
is a demo version of the game out there
Is there a demo version?
I wish there was a demo version
is a demo out there?';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php