如何在asp.net上进行文本框正则表达式验证?

时间:2022-11-04 03:14:35

How to have TextBox regular expression validation on asp.net?

如何在asp.net上进行TextBox正则表达式验证?

I will have to allow 3 digits and units in the text box. Decimal units should not exceed more than 2 units.

我必须在文本框中允许3个数字和单位。十进制单位不应超过2个单位。

How to handle that?

怎么处理?

<input  class="form-control"  id="Temperature" />

1 个解决方案

#1


1  

You need this regular expression, as I understood in your comment:

你需要这个正则表达式,正如我在你的评论中所理解的:

\d{1,3}\.\d{1,2}

Have a look at Demo

看看Demo

#1


1  

You need this regular expression, as I understood in your comment:

你需要这个正则表达式,正如我在你的评论中所理解的:

\d{1,3}\.\d{1,2}

Have a look at Demo

看看Demo