Reputation: 509
I am writing script to check if my password string contains at least one special character in it. I learned regex is not possible with InnoSetup.
Could someone help me in achieving this?
Thanks in Advance,
DeeJay
Upvotes: 1
Views: 1712
Reputation: 45293
[code]
function PasswordContainsAtLeastOneSpecialChar(Pass : String) : Boolean;
var
i : integer;
begin
Result := false;
for i:=1 to length(Pass) do
begin
case Pass[i] of
'!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '\', '*', '#': // list all special characters here
begin
Result := true;
Exit;
end;
end;
end;
end;
Upvotes: 6