Validation
Email Local Part (Before @)
Validate just the local part of an email address (the bit before the @).
Try it in RegexPro →Available in
Pattern
regexengine-agnostic
^[a-zA-Z0-9._%+\-]{1,64}$Raw source: ^[a-zA-Z0-9._%+\-]{1,64}$
How it works
^ and $ anchor to the full string. [a-zA-Z0-9._%+\-] is the conservative local-part character set (dots, underscores, percent, plus, hyphen for sub-addressing). {1,64} enforces the RFC max length for the local part.
Examples
Input
john.doeMatches
john.doe
Input
user+tagMatches
user+tag
Input
has spaceNo match
—Common use cases
- •Validating partial email input as the user types
- •Splitting and re-assembling email addresses
- •Sub-address (plus-tag) handling in mail systems
- •Form-by-form local-part-only collection
Related patterns
Email Domain Part (After @)
ValidationValidate just the domain portion of an email address — the bit after the @.
Email Address Validation
ValidationMatch and validate email addresses in the standard user@domain.tld format.
BCP 47 Language Tag
ValidationValidate BCP 47 language tags like `en`, `en-US`, `zh-Hant-TW`, or `pt-BR`.
Cron Expression
ValidationValidate standard 5-field Unix cron expressions: minute, hour, day-of-month, month, day-of-week.