我有一个文本框:
<asp:RegularExpressionValidator ID="ValidateTitleCharacters" runat="server"
ValidationExpression="^[a-zA-Z0-9@+'.!#$',:;=/\(\),\-\s]{1,255}$"
ControlToValidate="title" Text="You have entered a character(s) that is not allowed in the title."
ErrorMessage="You have entered a character(s) that is not allowed in the title." />
我也想允许 " 字符。如何修改正则表达式字符串???
我试过这个:
<asp:RegularExpressionValidator ID="ValidateTitleCharacters" runat="server"
ValidationExpression="^[a-zA-Z0-9@+'.!#$'\",:;=/(),\-\s]{1,255}$"
ControlToValidate="title" Text="You have entered a character(s) that is not allowed in the title."
ErrorMessage="You have entered a character(s) that is not allowed in the title." />
<asp:RegularExpressionValidator ID="ValidateTitleCharacters" runat="server"
ValidationExpression="^[a-zA-Z0-9@+'.!#$',:;=/()(""),\-\s]{1,255}$"
ControlToValidate="title" Text="You have entered a character(s) that is not allowed in the title."
ErrorMessage="You have entered a character(s) that is not allowed in the title." />
两次尝试都在破坏字符串。