我必须对文本框中的文本进行一些模式匹配。我在 C# 服务器的回发事件中这样做。我的正则表达式如下:
public bool ValidatePassword(string temp)
{
bool isMatch = false;
passwd = passwd.Trim();
isMatch = Regex.IsMatch(temp,
@"^ # Start of string
(?=.*\p{Lu}) # Assert at least one uppercase letter
(?=.*\p{Ll}) # Assert at least one lowercase letter
(?=.*\d) # Assert at least one digit
(?=.*[^\p{L}\d]) # Assert at least one other character
.{8,13} # Match at least 8 characters and maximum of 13 characters
$ # End of string",
RegexOptions.IgnorePatternWhitespace);
return isMatch;
}
我想将其移至 Javascript,以便在客户端进行匹配。有人可以帮我将此功能移至 Javascript 吗?