Link | st_valid_email |
Author | Brian Loomis |
Category | Custom Tag |
Version | 8.x |
License | Public Domain |
Posted | 28 Feb 2009 |
Updated | 28 Feb 2009 |
More by this author... |
This tag allows a single email to be validated for proper format. It uses a simple regular expression to test whether the email conforms to the following standards.
1) The top level domain is at least two and not more than six characters.
2) Subdomains are supported.
3) Usernames may contain underscores or periods and may start with underscores or end with them, but not periods.
4) Domains may be IP address but cannot contain other characters that are non alpha numeric.
5) And more...
Based on code scavenged from http://regexlib.com/
[//Lasso include:'/components/inSite/st_email_valid.inc'; // valid addresses; st_email_valid: -email='stevejobs@mac.com'; st_email_valid: -email='steve.jobs@mac.com'; st_email_valid: -email='steve_jobs@mac.com'; st_email_valid: -email='steve_jobs@mac.com'; st_email_valid: -email='hello@worl_d.com'; st_email_valid: -email='simpleone@mac.co.uk'; st_email_valid: -email='_test_@test.com'; // in-valid addresses; st_email_valid: -email=' steve_jobs@mac.com'; st_email_valid: -email='steve_jobs@mac.com '; st_email_valid: -email='steve_jobs @mac.com '; st_email_valid: -email='steve_ jobs@mac.com'; st_email_valid: -email='.test.@test.com'; st_email_valid: -email='spammer@[203.12.145.68]'; st_email_valid: -email='bla@bla'; st_email_valid: -email='@foo.com '; st_email_valid: -email='a@a'; st_email_valid: -email='-a-@-b-.cd'; st_email_valid: -email='--b@c__d.ef'; st_email_valid: -email='he&llo@world.co1'; st_email_valid: -email='.hello@wor#.co.uk'; ]
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.
> #mylocal); #RegChecker->Insert(#mylocal); /if; /iterate; if(#RegChecker == #EmailCheck); return:true; else; //return: $EmailCheck; return:false; /if; /define_tag; /**************************************************************************** Use it like in the examples above. *****************************************************************************/ ?>
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft