我使用這個正則表達式,但我有問題在Asp驗證可以有人幫助嗎?問題與正則表達式爲加拿大郵政編碼
^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ][ -]?\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i
,嘗試匹配, X#X#X#, X#X-#X#, X#X#X#
<Label For="PostalCode" Text="*Postal Code:" /><br>
<TextBox ID="PostalCode" class="txt postal postalError" DataField="PostalCode" Placeholder="A1A 1A1" DataType="String" /> <br/>
<Validate Target="PostalCode" CssClass="NormalRed xmp-validation clearfix" Type="required" text="* Postal Code is required." Message=""></Validate>
<Validate Target="PostalCode" CssClass="NormalRed xmp-validation clearfix" Type="regex" Text="* Postal Code must be formatted as follows: A1A 1A1" Message="" ValidationExpression="^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ][ -]?\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i"></Validate>
它是什麼,你實際使用,這看起來像它可能是ASP.Net不是傳統的ASP *(這是你標記爲問題)*? – Lankymart