Regular Expressions in .NET

By Samir Bhogayta Oct 29, 2013
This blog defines regular expressions in .net.

Positive decimal value regular expression with max 3 decimal places:

Regular Expressions, .NET, C# Programming Language

  • Accepts all positive decimal values (currently only accepts values greater and equal to one (1))
  • i.e accepts ---> 0.0001
  • Can have maximum 3 decimal places.
  • Decimal places are optional.

This regular expression will be used to validate currency input.

1:ValidationExpression="^\d*[1-9]\d*(\.\d+)?$"

Validate Indian Vehicle Number:

@"^[a-zA-Z]{2}[a-zA-Z0-9]{0,6}[0-9]{3}$"

Samir Bhogayta

I have over 5 yrs of experience working with Microsoft Technologies. Currently working with ASP.NET, MVC, C#, VB.NET, Ajax, Html, CSS, Bootstrap, SQL Server, Telerik Controls etc.

COMMENT USING