私はテキストボックスを持っています:
<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." />
どちらの試みも文字列を壊しています。