我正在尝试进行阻止“^$/()|?+[]{}><”元字符的服务器端验证任何人都可以让我了解为什么会这样。我是新手:/(TextBox3 是一个接受输入的 asp 文本框)
Imports System.Text.RegularExpressions
Partial Class Default2
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If Regex.IsMatch(TextBox3.Text, "^$\/()|?+[]{}><") Then
Label1.Text = "Invalid input"
End If
End Sub
End Class
错误:
Exception Details: System.ArgumentException: parsing "^$\/()|?+[]{}><" - Unterminated [] set.