What is the significance of the dot (.) in a regular expression pattern when using ereg() in PHP?

The dot (.) in a regular expression pattern when using ereg() in PHP matches any character except a newline. If you want to match a literal dot (.) character, you need to escape it with a backslash (\). This is important to remember when writing regular expressions to ensure accurate pattern matching.

$pattern = "example\.com";
$string = "Visit my website at example.com";
if (ereg($pattern, $string)) {
    echo "Pattern found in string!";
} else {
    echo "Pattern not found in string.";
}