I'm trying to match the parts of a version number (Major.Minor.Build.Revision) with C# regular expressions. However, I'm pretty new to writing Regex and even using Expresso is proving to be a little difficult. Right now, I have this:
(?<Major>\d*)\.(?<Minor>\d*)\.(?<Build>\d*)\.(?<Revision>\d*)
This works, but requires that every part of the version number exists. What I would like to do is also match versions like:
2.13
In this case, the Build and Revision groups need to return null values. Feel free to suggest a better method if I'm going about this all wrong.