Validate an Email Address in Larzscript
Check whether a string is a plausible email address - no regex of your own to get subtly wrong.
validate.is_email() checks for exactly one @, a non-empty local part and domain, a dot in the domain that isn't at either edge, and no whitespace.
larzscript pkg install validate
Code
import "validate" as validate
print(validate.is_email("a@b.com"))
print(validate.is_email("not-an-email"))
print(validate.is_email("missing@domain"))Output
true false false
Related
larzvalidateSchema validation for whole records, plus standalone email/URL/injection hygiene checks→Make an HTTP GET Request in LarzscriptFetch a URL and read its status code and body - or parse a JSON API response directly.→Sign and Verify a Webhook Payload in LarzscriptSign an outgoing webhook payload with HMAC-SHA256, and verify an incoming one - the same shape real payment/webhook providers use.→Hash Data with SHA-256 in LarzscriptCompute a real SHA-256 hash and an HMAC-SHA256 message authentication code.→