1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
Define_tag(
'email2',
-namespace='valid_',
-Priority='replace',
-required='email',
-type=string);
local('result' = true);
(#email == NULL || #email == '') && (#email->(EndsWith:'.') && #email !>> '@') ? return:false;
#email->trim;
#email !>> '@' ? return:false;
#email->(EndsWith:'.') ? return:false;
#email->(EndsWith:'@') ? return:false;
Local('illegal' = (array: '`','~','!','$', '#','^','&','*','(',')','+','=',' '));
Local('theSplit' =# email->(split:'@'));
#theSplit->(size) != 2 ? return:false;
#theSplit->second == '' ? return:false;
#theSplit->second !>> '.' ? return:false;
// Loop through all the the illegal characters
iterate:#illegal, local:'i';
#email->(Contains:#i) ? return:false;
/iterate;
return:#result;
/Define_tag;
|