$to_match=$_SERVER['REQUEST_URI'];
if (preg_match("/some_words/i", $to_match))

{
$to_match=preg_replace('#some_words/#is','replace_with_this',$to_match);
}