reg exp to validate version

  • Thread starter Thread starter gilligan
  • Start date Start date
G

gilligan

ahoy lads,

whatz a regular expression to validate the AssemblyVersionAttribute version
part. ie i want to validate a string is in the format 12.3.* or 3.4.0.0

I have ^([0-9])((\\.[0-9]))(((\\.\\*)|((\\.[0-9]))((\\.[0-9])))) but it
doesn't fails on 12.3.* because of the 12 but will validate 1.3.*

cheers lads - gilli
 
Hi,

It should be something like this:

string re = @"^[0-9]+\.[0-9]+\.(\*|[0-9]+)\.(\*|[0-9]+)$"
 
Back
Top