|
فهميدن اينکه آيا يک ايميل از نظر املايي درست است
يا نه
Function IsValidMail(mail:string):Boolean;
var
i,Dot,AtSine:longInt;
tmpMail:string;
ch:char;
begin
result:=false;
If mail='' then exit;
tmpMail:=lowercase(mail);
AtSine:=pos('@',tmpMail);
Dot:=PosEx('.',tmpMail,atsine);
If Dot>AtSine then begin
for i:=1 to length(tmpMail) do begin
ch:=(tmpMail[i]);
If not( (ch in ['a'..'z']) or (ch in ['0'..'9']) or (ch in ['-','_','.']) )
then
begin
Result:=false;
Exit;
end;
end;
Result:=True;
end;
end;
| |
|