Lasso Soft Inc. > Home

[st_valid_email]

Linkst_valid_email
AuthorBrian Loomis
CategoryCustom Tag
Version8.x
LicensePublic Domain
Posted28 Feb 2009
Updated28 Feb 2009
More by this author...

Description

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/

Sample Usage

[//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';

]

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.

> #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.
*****************************************************************************/
?>

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