使用php在字符串中查找匹配的单词

i want to search matching word in string like if i have a string

"i'm expert in ..."
"i have exposure "

if i search "exp" i should return "expert" from first string and "exposure" from second string, if i search "exper" than i should just return "expert" or other words starting "exper"

i'm not looking for position of word but return searched word with in string

i have looked for this all i found strstr(),strrpos() and some others but not what i'm looking for and i'm unable to get it working

You can find all the words starting with exp using pre_match or preg_match_all and the regex:

/(exp\w*)/g

You can test it here.

Very similar to enrico:

/(exp\w+)/gi

here http://regex101.com/r/xO9eR7/1