How can I use preg_replace to determine if a string contains a word beginning with a pattern, and if it does, remove it?
Basically I want to capture query strings from a search, but throw away search modifiers. For example, the search query string:
would just become
In this case, I want to remove all words in the string that begin with 'site:'.