Hi
I am wondering hot to search a sentence to see if it has a matching case like the following:
‘I am ANY_WORD_HERE.’
Basically I need the I am + a word + a period after a word.
Any ideas?
I will post anything here if I find it before I get help.
Thanks,
Chris
$sentence = 'I am ANY_WORD_HERE.';
preg_match('/^I am (.*?)\\./', $sentence, $match);
print_r($match);
One thing: it matches anything until the first period, so “I am a really huge bear.” will also match (a really huge bear), while “I am here. Go away” will only match “here” and “I am. You are” will not match.