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]+)$"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top