Lasso Soft Inc. > Home

[valid_email2]

Linkvalid_email2
AuthorAlex Pilson
CategoryEmail
Version8.x
LicensePublic Domain
Posted29 Nov 2005
Updated16 Jan 2006
More by this author...

Description

A better email validation tag.

Sample Usage

valid_email2:'alex.p@flag@ship.com';

Source Code

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;

Related Tags

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft