How exactly to inspect the mail-id in the given scenario
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Application Programming

#1: How exactly to inspect the mail-id in the given scenario Author: me_naveen PostPosted: Mon Jun 25, 2018 1:20 am
    —
Hi,

I have a field such as mail-id. Need to validate as below.

mail-id new rule as:

mail id could have comment also included(optional).But , in case if included
could be included at start or end of the local part of the mail-id(before @ symbol).

Examples as
subject(comment)@sub.com ==> VALID
(comment)subject@sub.com ==> VALID

sub(comment)ject@sub.com ==> Invalid ( '(comment)' is included in the local part other than start or end of local part of the mail-id.

In case comment such as (comment) comes other than start or end of the mail-id , it should throw an error.

How could I implement such logic.

Thanks in advance.
Nav

#2:  Author: Nic CloustonLocation: At Home PostPosted: Mon Jun 25, 2018 3:56 am
    —
You do not mention which programming language you are using so this is a generic answer:
Code:
Split the line at the @ sign
Check that there is a '(' in the first string
If yes
   If the first character is '@' or the last character is ')'
   Then OK
   Else give error (do not 'throw' an error as errors are not 'throw' on the mainframe)

#3:  Author: me_naveen PostPosted: Mon Jun 25, 2018 5:18 am
    —
Hi,

Sorry for not including the Programming Language.

This is for COBOL.

Thanks,
Nav

#4:  Author: Nic CloustonLocation: At Home PostPosted: Mon Jun 25, 2018 8:16 am
    —
Still. that spec will work for a routine written in COBOL.



MVSFORUMS.com -> Application Programming


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group