Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Validador de Email em Pawn (algorítimo Simples e Eficiente)
- * Copyright (C) 2011 Bruno da Silva <brunoemail@r7.com>
- * www.ips-team.blogspot.com - [iPs]TeaM
- */
- //]]]]]]]]]]]]]]]]]]]]] Função ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
- isEmail(email[])
- {
- if (!email[0]) return false;
- new
- len = strlen(email),
- arroba = 0,
- ponto = 0;
- for( ; arroba != len; arroba++) {
- if(!(email[arroba] - 64)) {
- for( ponto = arroba; ponto != len; ponto++) {
- if(!(email[ponto] - 46)) {
- break;
- }
- }
- break;
- }
- }
- return (arroba + 1 < ponto < len && ponto && arroba);
- }
- //]]]]]]]]]]]]]]]]]]]]] Exemplos ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
- printf("brunosilva@r7.com %d", isEmail("brunosilva@r7.com"));
- printf("brunosilva@.com %d", isEmail("brunosilva@.com"));
- printf("@aaa.com %d", isEmail("@aaa.com"));
- printf("bb@bbb. %d", isEmail("@aaa.com"));
- printf(".com %d", isEmail("@aaa.com"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement