Pattern for check single occurrency into preg_match_all
问题 I'm writing a function that should retrieve all occurrences that I pass. I'm italian so I think that I could be more clear with an example. I would check if my phrase contains some fruits. Ok, so lets see my php code: $pattern='<apple|orange|pear|lemon|Goji berry>i'; $phrase="I will buy an apple to do an applepie!"; preg_match_all($pattern,$phrase,$match); the result will be an array with "apple" and "applepie". How can I search only exact occurency? Reading the manual I found: http://php.net