ASP.NET 正则表达式 - 不允许网站网址



我正在使用 ASP.net 4.5 和引导程序。下面是我必须只允许某些字符的代码。我怎样才能更改它以允许字符 a-zA-Z0-9_./,&|((!- 但不允许用户输入HTTPwww。

<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."
                                    />
我想

说你可能不得不为你不想在输入值中使用的单词添加组。

((!|www)|(!|http))

你也可以看看这个类似问题的答案,在那里你应该得到足够的输入来修复你的表达式

最新更新