mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-20 22:14:34 -04:00
87b3dcd780
(cherry picked from commit 40f4ef27b22113c1dae0d0cbdee8205132bed68a)
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;
|
|
}
|
|
}
|