What are some potential pitfalls of using eregi in PHP for regular expressions?

Using eregi in PHP for regular expressions is not recommended as it is case-insensitive and has been deprecated since PHP 5.3.0. Instead, it is recommended to use the preg_match function with the 'i' modifier for case-insensitive matching.

// Using preg_match with 'i' modifier for case-insensitive matching
$string = "Hello World";
if (preg_match("/hello/i", $string)) {
    echo "Match found!";
} else {
    echo "No match found.";
}