IsValidMail

From Multi Theft Auto: Wiki
Revision as of 10:31, 20 July 2014 by Justin Roth (talk | contribs) (Created page with "{{Useful Function}} <lowercasetitle/> __NOTOC__ This function allows you to check e-mails, if they are in the correct format. ==Syntax== <syntaxhighlight lang="lua">bool isValidMail ( stri...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


This function allows you to check e-mails, if they are in the correct format.

Syntax

bool isValidMail ( string mail )

Returns

Returns true when the email was valid, false when the email was invalid

Code

<section name="Clientside and Serverside Script" class="server" show="true">

function isValidMail(mail) 

	return mail:match("[A-Za-z0-9%.%%%+%-]+@[A-Za-z0-9%.%%%+%-]+%.%w%w%w?%w?") ~= nil
	
end