stock IsValidMailAddr(const addr[])
{
new len = strlen( addr ),
atcount = ( 0 ), IsValid = false
;
if( len < 5 ){
IsValid = false;
goto IsValidMailAddr__the_end;
}
loop:len(i){
if( addr == \'@\' ) atcount ++;
if( atcount > 1 ){
IsValid = false;
break;
}
if( ( addr >= \'a\' && addr <= \'z\' ) || ( addr >= \'A\' && addr <= \'Z\' ) || ( addr == \'.\' ) || ( addr == \'_\' ) || ( addr == \'-\' ) )
IsValid = true;
else{
if( ( addr != \'@\' ) ){
IsValid = false;
break;
}
}
if( i + 1 == len )
if( ( ( addr >= \'a\' && addr <= \'z\' ) || ( addr >= \'A\' && addr <= \'Z\' ) ) && ( addr != \'.\' ) )
IsValid = true;
if( i + 1 == len && addr == \'.\' ) //unneeded?
IsValid = false;
}
IsValidMailAddr__the_end:
return IsValid ? true : false;
}
Hivatalos fórumon találtam, nem biztos hogy jó.