What are the advantages of using preg_match() over eregi() for regular expression matching in PHP?

The `eregi()` function in PHP is deprecated as of PHP 5.3.0 and removed in PHP 7. Instead, it is recommended to use the `preg_match()` function for regular expression matching in PHP. `preg_match()` offers more flexibility and power in regular expression matching compared to `eregi()`.

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