Skip to contents

Check email addresses before database insertion or API calls to catch obvious typos and malformed input early. Validates against a standard RFC-compliant pattern. Use this in form validation and before calling create_waitlist_entry() or log_whitepaper_download() to provide immediate user feedback.

Usage

is_valid_email(email)

Arguments

email

Character string. The email address to validate. Must contain exactly one '@' symbol, a domain name, and a top-level domain (TLD). Examples: "user@example.com" (valid), "user@domain" (invalid - no TLD).

Value

Logical. TRUE if email format is valid, FALSE otherwise. Note: This only validates format, not whether the email address actually exists or can receive mail.

See also

Examples

is_valid_email("user@example.com")
#> [1] TRUE
# TRUE

is_valid_email("not-an-email")
#> [1] FALSE
# FALSE

is_valid_email("user@domain")
#> [1] FALSE
# FALSE (missing TLD)