Matching version number parts with regular expressions

后端 未结 6 2355
滥情空心
滥情空心 2021-02-15 14:28

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

6条回答
  •  囚心锁ツ
    2021-02-15 14:56

    If you don't want to use Regex you could try:

    System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo();
    
    int major = fvi.FileMajorPart;
    int minor = fvi.FileMinorPart;
    int build = fvi.FileBuildPart;
    

提交回复
热议问题