Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 我可以在MVC的@Html.Editor中使用用户模式吗?_Regex_Asp.net Mvc - Fatal编程技术网

Regex 我可以在MVC的@Html.Editor中使用用户模式吗?

Regex 我可以在MVC的@Html.Editor中使用用户模式吗?,regex,asp.net-mvc,Regex,Asp.net Mvc,我们可以使用模式(regex)来控制输入 就像这样: <input type="text" name="country_code" pattern="[A-Za-z]{3}" title="Three letter country code"> 但是pattern=“[A-Za-z]{3}”无法识别我已经尝试了你的代码,它运行良好。你能添加表单标记代码,让我看看你的代码中到底发生了什么吗?intellisense get PatternMatcher类我认为它不能使用,它可以使用,

我们可以使用模式(regex)来控制输入 就像这样:

<input type="text" name="country_code" pattern="[A-Za-z]{3}" title="Three letter country code">

但是pattern=“[A-Za-z]{3}”无法识别

我已经尝试了你的代码,它运行良好。你能添加表单标记代码,让我看看你的代码中到底发生了什么吗?intellisense get PatternMatcher类我认为它不能使用,它可以使用,即使我已经使用了很多次,但如果没有需要查看的代码我认为问题在于Visual Studio intellisense我已经尝试了你的代码,它运行良好。你能添加表单标记代码,这样我就可以看到你的代码中真正发生了什么吗?intellisense get PatternMatcher类我认为它不能使用,它可以使用,即使我已经使用了很多次,但无法说出它是什么在没有必需代码的情况下出错我认为问题在于Visual Studio intellisense
@Html.Editor("country_code", null, new { htmlAttributes = new { @class = "form-control" , required = "required" , pattern="[A-Za-z]{3}"} })