From efb10600f32478c4a2664894bf949ee2139fb49a Mon Sep 17 00:00:00 2001 From: Gert Dreyer Date: Thu, 27 May 2021 11:48:38 +0200 Subject: [PATCH] Fix Version Regex to handle with Output Prefix correctly --- Asterisk.2013/Asterisk.NET/Common.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Asterisk.2013/Asterisk.NET/Common.cs b/Asterisk.2013/Asterisk.NET/Common.cs index cfc8e43..93a62e1 100644 --- a/Asterisk.2013/Asterisk.NET/Common.cs +++ b/Asterisk.2013/Asterisk.NET/Common.cs @@ -18,8 +18,8 @@ namespace AsterNET /// Line separator public const string LINE_SEPARATOR = "\r\n"; - public static Regex ASTERISK_VERSION = new Regex( "^Asterisk\\s+\\D*([0-9]+\\.[0-9]+\\.[0-9]+|[1-9][0-9]-r[0-9]+|[0-9]+\\.[0-9]+-cert[0-9]).*$", - RegexOptions.Compiled | RegexOptions.IgnoreCase ); + public static Regex ASTERISK_VERSION = new Regex("^(?:Output: ){0,1}Asterisk\\s+\\D*([0-9]+\\.[0-9]+\\.[0-9]+|[1-9][0-9]-r[0-9]+|[0-9]+\\.[0-9]+-cert[0-9]).*$", + RegexOptions.Compiled | RegexOptions.IgnoreCase ); public static Regex SHOW_VERSION_FILES_PATTERN = new Regex("^([\\S]+)\\s+Revision: ([0-9\\.]+)"); public static char[] RESPONSE_KEY_VALUE_SEPARATOR = {':'};