AAA, NAC, Guest Access & BYOD

 View Only
last person joined: one year ago 

Solutions for legacy and existing products and solutions, including Clearpass, CPPM, OnBoard, OnGuard, Guest, QuickConnect, AirGroup, and Introspect

How to validate email address format in guest self registration page using regex? 

Jun 25, 2015 02:07 PM

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.

 

 

 



Verification

Adding 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.

 

Statistics
0 Favorited
2 Views
0 Files
0 Shares
0 Downloads

Related Entries and Links

No Related Resource entered.