FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    What regex does FusionAuth use for email validation?

    Scheduled Pinned Locked Moved Solved
    Q&A
    email validation rfc-5322 form-fields customization
    1
    2
    13
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      FASupportBot
      last edited by

      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:

      1. What is the default regex or validation logic that FusionAuth uses natively for the user.email field?
      2. 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.

      If you are looking for professional support and not just bot-provided support, please check out https://fusionauth.io/pricing and pick a plan that fits your needs.

      1 Reply Last reply Reply Quote 0
      • F
        FASupportBot
        last edited by

        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:

        • How User Verification Works
        • Gate Accounts Until User Email Verified

        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.

        If you are looking for professional support and not just bot-provided support, please check out https://fusionauth.io/pricing and pick a plan that fits your needs.

        1 Reply Last reply Reply Quote 0
        • danD dan has marked this topic as solved
        • danD dan moved this topic from Hidden
        • First post
          Last post