What regex does FusionAuth use for email validation?
-
We are currently reviewing the email validation rules in our microservices and want to update our internal logic to match exactly what FusionAuth uses out-of-the-box. This will help us prevent any validation mismatches across our services.
Could you help us confirm:
- What is the default regex or validation logic that FusionAuth uses natively for the
user.emailfield? - If we decide to tweak our email validation rules down the road, can we fully override FusionAuth's default behavior by setting a custom validator under Customizations > Form Fields?
I checked RFC 5322 (Internet Message Format), but couldn't find an exact regex defined there. I understand that email validation can vary depending on the use case, but we would like to use the same regex on our end to keep validation consistent.
- What is the default regex or validation logic that FusionAuth uses natively for the
-
FusionAuth follows RFC 5322 for standard email validation, which defines the local part as a
dot-atom. However, FusionAuth does not expose a specific custom regex for email validation—it adheres to the RFC 5322 standard.Can you override or customize email validation?
Yes, but only partially through FusionAuth's built-in features:
- You can customize validation using Customizations > Form Fields in the FusionAuth admin UI.
- However, if you want to completely implement your own validation logic, you would need to handle that within your own application and your own pages/API.
Resources
Here are some helpful links for managing user verification and email validation workflows:
If you need exact custom validation logic, you'll need to implement it on your application side and potentially use custom form fields to enforce it during registration or profile updates.
-
D dan has marked this topic as solved
-
D dan moved this topic from Hidden
-
D dan moved this topic from Q&A
-
D dan moved this topic from Frequently Asked Questions (FAQ)
-
D dan moved this topic from Q&A