mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-17 21:44:48 -04:00
17 lines
423 B
C#
17 lines
423 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;
|
|
}
|
|
}
|