Title: What can I use to perform an email validation during entry-field accept?

Starting from the 2013 R2 the regular expression is supported on entry-field control. The power of regular expression is now available also during entry-field accept. The following example shows how to declare regular expression on a screen section entry-field:

           03 e1 entry-field line 2 col 2 size 50 value var
              validation-regexp "^w+[w-.]*@w+((-w+)|(w*)).[a-z]{2,3}$"
              validation-errmsg "Invalid email address"
              validation-opts 7.
Due to the above code, if the entry-field content doesn't match with the regexp specified by validation-regexp, then the message specified by validation-errmsg is automatically shown by the runtime and the focus is kept on the field. validation-opts=1 means that the check is done case insensitive

Matches bob-smith@foo.com | bob.smith@foo.com | bob_smith@foo.com

Non-Matches -smith@foo.com | .smith@foo.com | smith@foo_com

The regexp syntax must respect Java specifications http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html.

Regular Expression are collected and discussed on the web. For example, on this web site http://regexlib.com/ you can find ready-to-use expression for common issues as well as an online regexp validator tool.

Authored by: Veryant Support on Wed, Nov 20th, 2013 at 7:00 PM
This question has been viewed 5678 times so far.
Online URL: http://support.veryant.com/support/phpkb/question.php?ID=218

Powered by PHPKB Knowledge Base Software