为什么"\ d + {1,4}(?:[.,]\d {1,4})?" 在RegularExpressionValidator中抛出异常:"嵌套量词{"

aba*_*hev 2 .net regex asp.net validation

我有

<asp:RegularExpressionValidator ValidationExpression="\d+{1,4}(?:[.,]\d{1,4})?" />
Run Code Online (Sandbox Code Playgroud)

但它不起作用,解析器抛出ArgumentException:

解析"\ d + {1,4}(?:[.,]\d {1,4})?"

嵌套量词{.

我的错误在哪里?我想允许琴弦一样xxxx,xxxx-从1到4位,并且不需要十进制数字,如:1000,99,99,0,2498等.

Mar*_*ers 5

这看起来不对:

\d+{1,4}
Run Code Online (Sandbox Code Playgroud)

应该是这样的:

\d{1,4}
Run Code Online (Sandbox Code Playgroud)

+意思是"一个或多个"和{1,4}一至四个装置.它们不能一起使用,因为它没有意义.