[valid_email2]

Description

Link: [valid_email2]
Author: Alex Pilson
Category: Email
Version: 8.x
License: Public Domain
Posted: Nov. 29, 2005
Updated: Jan. 16, 2006
More by this author...
A better email validation tag.

Parameters

-email string, required The tag needs only parameter, an email address.

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.
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;

 

Related Tags



Comments

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net