Looking to implement an end user dialog that requires them to create their own password.
Must be 9 characters long. 1 char must be upper case, 1 must be lowercase, one must be a number, ['0'..'9'] and one must be from a set of 6 predefined ascii chars like so. ['!','#','%','&','*','@'].
Have this completed. and works. However, what I wanted to do to was provide visible verification using the onchange event to change the color of the edit box to green if all requirments where met or RED if not. Valdating for the 9 char length is easy enough however checking the 9 various chars to ensure there is at least 1 upper, 1 lower, 1 number and 1 of the predefined is proving a tad difficult. Can anyone help please? Thank you.
This is the code:
procedure TPasswordForm.edtPassword1Change(Sender: TObject);
begin
if Length(edtPassword1.Text <> 9 then
edtPassword1.Color := clRed
else
edtPassword1.Color := clLime;
end;