Requirement:How can I validate whether the entered email address is in proper format during the guest self registration?
In the Guest self registration > Edit > Register Page > Form > email field, we do have the Validator set to "ISValidEmail", however it accepts the value without Top Level Domain(TDLs). For example the below value will be accepted without the TDL (.com, .net, .org, etc.).
Ex: test@test
Solution:Alternatively we can use regular expression (REGEX) to validate the input values in the Guest self registration fields.
The below regex will help you to validate the email address format.
^[A-Za-z0-9.,_%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,3}$
Note: The domain prefix/suffix may contain special characters as shown below. The above expression has the special characters ".,_%+-" included in it, you can add more characters if required.
- test-abc@test.com
- test.abc@test.net
- test_abc@test-123.org
Configuration:To add the above regex in the email filed, please navigate to ClearPass Guest >> Configuration >> (Pages)Guest Self-Registration >> select the self-registration page and go to Edit >> Register Page >> Form >> select the email filed and set the Validator to " ISRegexMatch" and enter the above regex in the Validator Argument filed as shown below.
VerificationAdding the given regex in the email field will only allow the valid email address format. Please find below the results of both incorrect and correct email formats.
Email address without TLD.
Proper email format.