Skip to content

Instantly share code, notes, and snippets.

@moozzyk
Created September 19, 2015 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moozzyk/db065f7ef5df71f65975 to your computer and use it in GitHub Desktop.
Save moozzyk/db065f7ef5df71f65975 to your computer and use it in GitHub Desktop.
var m = Regex.Match("CentOS Linux release 7.1.1503(Core)", @"^(?<distro>\S+) \S+ \S+ (?<version>\d\.\d)\..+$");
if (m.Success)
{
Console.WriteLine($"Distro: {m.Groups["distro"]} Version: {m.Groups["version"]}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment