Question: Given a Textbox, that should contain a numeric value:

```
<asp:TextBox ID="txtHoldsAnInt" runat="server" />

```

In our codebase, generally a [RegularExpressionValidator](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.regularexpressionvalidator.aspx) is used for all validation (except required fields) such as the following:

```
<asp:RegularExpressionValidator ErrorMessage="..." ControlToValidate="txtHoldsAnInt" 
Text="*" runat="server" ValidationExpression="^[0-9]{1,8}$" />

```

Alternately, a [RangeValidator](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.rangevalidator.aspx) could be used to get the same result:

```
<asp:RangeValidator ErrorMessage="..." ControlToValidate="txtHoldsAnInt" 
MinimumValue="0" MaximumValue="99999999" Type="Integer" runat="server" />

```

Does the RegularExpressionValidator have an advantage over other validators, even when another validator would work? Are there any advantages to always using a RegularExpressionValidator?

Answer: 
If you are familiar with regular expressions, then I would recommend using the `<asp:RegularExpressionValidator`. You are correct that there is no noticeable difference when they are equal to each other, but the RegularExpressionValidator allows for easy editing later on when specifications change. For example with a RegularExpressionValidator it would be easy to allow for a percent sign at the end or any other change that might be requested.
In terms of functionality/end result, there is no difference between using the two. I would suggest using the range validator other validators if the situation permits and it satisfy your needs. It is much easier for someone to understand `<asp:RangeValidator` than to understand `^[0-9]{1,8}$`. While the `RegularExpressionValidator` will give you a much higher degree of control, if that control is not needed, then go for the simple solution and ease your maintenance efforts.