on 02-02-2015 9:15 AM
Hi Experts,
We have a requirement to validate Input email address for External Partners to be an email address from non-client domain.
Planning to validate the same using regex in 'Validation' tab of custom attribute 'Z_TEMP_EMAIL_EXT', mapped to the UI task used for External User ID creation.
Client has two email domains, namely 'FN.LN@clientabc.com' and 'FN.LN@xyzclient.com'
I have arrived at below regex for validating the client domain; and attempts to ensure these are NOT input (negative condition) are not working.
Please suggest how to validate regex for NOT including these domains.
(1) "^(.*)[\@](clientabc|xyzclient)[\.](com)"
(2) "^(.*)[\@](clientabc|xyzclient)[\.](.*)"
(3) "(\Qclientabc\E)|(\Qxyzclient\E)"
With Regards,
Ganesh.S
Hello Ganesh,
you want negative lookahead with alternation, like this:
.+@(?!clientabc\.com$|xyzclient\.com$).+
Please note, though, that the above regex does not provide any POSITIVE guarantee that the input is a valid SMTP address as specified by RFC2821.
It just provides a negative guarantee that the input is NOT an SMTP address from domains clientabc.com or xyzclient.com.
Best regards,
Lambert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ganesh,
another approach would be to use the UI extension classes if your requirements are too complex for Java regex.
I can give you some more useful information in PM if necessary.
Regards
Norman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.