Regular expression in XPage - email validation

Read our top 7 articles-

Regular expression in XPage - email validation :
You can use regular expression in XPage using very simple steps.
Here we will use simple validators to validate user email Id using regular expression.
Add few fields on XPage including email Field/ or if you have already added in your XPage then apply this email validation.
After adding email field on XPage. Click on Email field - Refer below screen.


Check for Email Field properties in property panel and then switch to the email field All properties box.

Next –click on Property ‘Validators’ and click on + sign button from values selector & select xp:validateConstraint – Refer below screen.

Use below regular expression code, this might have used before in your traditional lotus notes web application for email validation email, here the same code we have to apply-

Add this regular expression to regex property- refer below: ^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$;

Add your message for email validation in message property.
 For example – “Please enter valid email Id”

Now, save your XPage and check result in browser.

Here is the our result-
Screen A: Enter value and click on Save Button.


Screen B: Output.

Read our Best 5 articles-

  1. Learn XPage Repeat Control in Easy steps
  2. XPage Export To Excel using famous Client JavaScript in easy steps  
  3. XPage Export To Excel using Server side JavaScript 
  4. XPage Export To Excel using simple LotusScript
  5. XPage Mail Send Using very simple Lotus Script trick
  6. XPage Mail Send Using Server side JavaScript

Thanks for reading this article, hope you like it, if you have any difficulty, please feel free to contact us on ‘’ or click here to contact us.


Sycorax said...

This regexp is not working for me :-/

Amol Jalak said...
This comment has been removed by the author.
Amol Jalak said...

any error your are getting ? or nothing ?