mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-03-05 13:20:20 -05:00
17 lines
424 B
C#
17 lines
424 B
C#
using System;
|
|
using System.Text.RegularExpressions;
|
|
|
|
namespace NzbDrone.Core.Datastore;
|
|
|
|
public static class DatabaseVersionParser
|
|
{
|
|
private static readonly Regex VersionRegex = new (@"^[^ ]+", RegexOptions.Compiled);
|
|
|
|
public static Version ParseServerVersion(string serverVersion)
|
|
{
|
|
var match = VersionRegex.Match(serverVersion);
|
|
|
|
return match.Success ? new Version(match.Value) : null;
|
|
}
|
|
}
|