Link | valid_email2 |
Author | Alex Pilson |
Category | |
Version | 8.x |
License | Public Domain |
Posted | 29 Nov 2005 |
Updated | 16 Jan 2006 |
More by this author... |
A better email validation tag.
valid_email2:'alex.p@flag@ship.com';
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
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;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft