Are there any common pitfalls to avoid when implementing email validation using regular expressions in PHP?

One common pitfall to avoid when implementing email validation using regular expressions in PHP is not accounting for all valid email formats. To ensure accurate validation, it's important to use a comprehensive regular expression pattern that covers a wide range of valid email addresses.

$email = "example@example.com";

if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
    echo "Valid email address";
} else {
    echo "Invalid email address";
}