Inno setup如何检查一个字符串是否包含至少一个特殊字符

Inno setup how to check if a string contains at least one special character

我正在编写脚本来检查我的密码字符串中是否包含至少一个特殊字符。我了解到 InnoSetup 无法使用正则表达式。

有人可以帮我实现这个目标吗?

提前致谢,

DeeJay

[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;