「こんにちは世界」と書いたHello.txtを作って

<?php
foreach (file($argv[1]) as $line) {
  print mb_ereg_replace ("こんにちは","こんばんは",$line);
}
print "n";
?>

なtest.phpを書いて、
php -q text.php Hello.txt
で、
Warning: mb_ereg_replace(): mbregex compile err: premature end of regular expression in test.php
とおこられました。
mb_regex_encoding ("UTF-8");
でおさまりましたが、こんな感じでいいんでしょうか?