我正在使用ASP.net 4.5和bootstrap。 下面是我只允许某些字符的代码。 如何更改此设置以允许字符 a-zA-Z0-9_。 /,& |()! - 但不允许用户输入 http 或 www。
<input type="text" class="form-control" name="subject" id="subject" placeholder="Enter subject"
data-bv-message="The subject is not valid."
data-bv-notempty="true" data-bv-notempty-message="The subject is required and cannot be empty."
data-bv-regexp="true" data-bv-regexp-regexp="^[a-zA-Z0-9_. /,&|()!-]+$" data-bv-regexp-message="The subject can only consist of alphabetical, number, dot and underscore."
/>
答案 0 :(得分:0)