From b207d4c319d423065d2a13578bcba321ec0817e3 Mon Sep 17 00:00:00 2001 From: AJ Date: Sun, 24 Nov 2019 19:54:24 -0500 Subject: [PATCH] Changed drawing regex to static --- ExportDXF/DrawingInfo.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ExportDXF/DrawingInfo.cs b/ExportDXF/DrawingInfo.cs index 42c1c6c..4b6e4b2 100644 --- a/ExportDXF/DrawingInfo.cs +++ b/ExportDXF/DrawingInfo.cs @@ -4,6 +4,8 @@ namespace ExportDXF { public class DrawingInfo { + private static Regex drawingFormatRegex = new Regex(@"(?[34]\d{3}(-\d+\w{1,2})?)\s?(?[ABEP]\d+(-?(\d+|[A-Z]))?)", RegexOptions.IgnoreCase); + public string JobNo { get; set; } public string DrawingNo { get; set; } @@ -30,9 +32,7 @@ namespace ExportDXF public static DrawingInfo Parse(string input) { - const string pattern = @"(?[34]\d{3}(-\d+\w{1,2})?)\s?(?[ABEP]\d+(-?(\d+|[A-Z]))?)"; - - var match = Regex.Match(input, pattern); + var match = drawingFormatRegex.Match(input); if (match.Success == false) return null;