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}$"

Next Recommended Reading Regular Expressions in ASP.NET