Firstly, as I heard a couple of times as well as read in php manual, preg_something functions are better then eregi_something, so use preg_replace.
Next, for the regex:
<?php
$query = 'Some text This part needs to be replaced some other text';
echo preg_replace('/This part needs(.*)$/','',$query);
?>
This will echo "Some text ".
It searches for the string "This part needs" and every character (dot) 0 or more times (asterisk) until the end of the string (dollar).
Get yourself some regex cheatsheat - learning the basics is not so difficult.