From b7bfa3ba286d7c33a2d9c1470a1bdeaa73aed808 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 24 May 2019 11:18:49 -0700 Subject: [PATCH] Readonly Regex, Rather --- DICUI.Library/Data/SubmissionInfo.cs | 54 ++++++++++++++-------------- DICUI.Library/Web/RedumpAccess.cs | 6 ++-- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/DICUI.Library/Data/SubmissionInfo.cs b/DICUI.Library/Data/SubmissionInfo.cs index 6a65530e..dc037577 100644 --- a/DICUI.Library/Data/SubmissionInfo.cs +++ b/DICUI.Library/Data/SubmissionInfo.cs @@ -259,43 +259,43 @@ namespace DICUI.Data #region Regexes - private Regex addedRegex = new Regex(@"Added(.*?)"); - private Regex barcodeRegex = new Regex(@"Barcode(.*?)"); - private Regex bcaRegex = new Regex(@"

BCA .*?/>

" + private readonly Regex addedRegex = new Regex(@"Added(.*?)"); + private readonly Regex barcodeRegex = new Regex(@"Barcode(.*?)"); + private readonly Regex bcaRegex = new Regex(@"

BCA .*?/>

" + "RowContentsASCII" + "(?.*?)(?.*?)(?.*?)" + "(?.*?)(?.*?)(?.*?)" + "(?.*?)(?.*?)(?.*?)" + "(?.*?)(?.*?)(?.*?)"); - private Regex categoryRegex = new Regex(@"Category(.*?)"); - private Regex commentsRegex = new Regex(@"Comments(.*?)"); - private Regex contentsRegex = new Regex(@"Contents(.*?)"); - private Regex discNumberLetterRegex = new Regex(@"\((.*?)\)"); - private Regex dumpersRegex = new Regex(@""); - private Regex editionRegex = new Regex(@"Edition(.*?)"); - private Regex errorCountRegex = new Regex(@"Errors count(.*?)"); - private Regex foreignTitleRegex = new Regex(@"

(.*?)

"); - private Regex fullMatchRegex = new Regex(@"full match ids: (.*?)"); - private Regex languagesRegex = new Regex(@"\s*"); - private Regex lastModifiedRegex = new Regex(@"Last modified(.*?)"); - private Regex mediaRegex = new Regex(@"Media(.*?)"); - private Regex partialMatchRegex = new Regex(@"partial match ids: (.*?)"); - private Regex pvdRegex = new Regex(@"

Primary Volume Descriptor (PVD)

" + private readonly Regex categoryRegex = new Regex(@"Category(.*?)"); + private readonly Regex commentsRegex = new Regex(@"Comments(.*?)"); + private readonly Regex contentsRegex = new Regex(@"Contents(.*?)"); + private readonly Regex discNumberLetterRegex = new Regex(@"\((.*?)\)"); + private readonly Regex dumpersRegex = new Regex(@"
"); + private readonly Regex editionRegex = new Regex(@"Edition(.*?)"); + private readonly Regex errorCountRegex = new Regex(@"Errors count(.*?)"); + private readonly Regex foreignTitleRegex = new Regex(@"

(.*?)

"); + private readonly Regex fullMatchRegex = new Regex(@"full match ids: (.*?)"); + private readonly Regex languagesRegex = new Regex(@"\s*"); + private readonly Regex lastModifiedRegex = new Regex(@"Last modified(.*?)"); + private readonly Regex mediaRegex = new Regex(@"Media(.*?)"); + private readonly Regex partialMatchRegex = new Regex(@"partial match ids: (.*?)"); + private readonly Regex pvdRegex = new Regex(@"

Primary Volume Descriptor (PVD)

" + @"Record / EntryContentsDateTimeGMT" + @"Creation(?.*?)(?.*?)(?.*?)(?.*?)" + @"Modification(?.*?)(?.*?)(?.*?)(?.*?)" + @"Expiration(?.*?)(?.*?)(?.*?)(?.*?)" + @"Effective(?.*?)(?.*?)(?.*?)(?.*?)"); - private Regex regionRegex = new Regex(@"Region
"); - private Regex ringCodeDoubleRegex = new Regex(@""); // Varies based on available fields, like Addtional Mould - private Regex ringCodeSingleRegex = new Regex(@""); // Varies based on available fields, like Addtional Mould - private Regex serialRegex = new Regex(@"Serial(.*?)"); - private Regex systemRegex = new Regex(@"System"); - private Regex titleRegex = new Regex(@"

(.*?)

"); - private Regex trackRegex = new Regex(@"(?.*?)(?.*?)(?.*?)(?.*?)(?.*?)(?.*?)(?.*?)(?.*?)(?.*?)"); - private Regex trackCountRegex = new Regex(@"Number of tracks(.*?)"); - private Regex versionRegex = new Regex(@"Version(.*?)"); - private Regex writeOffsetRegex = new Regex(@"Write offset(.*?)"); + private readonly Regex regionRegex = new Regex(@"Region
"); + private readonly Regex ringCodeDoubleRegex = new Regex(@""); // Varies based on available fields, like Addtional Mould + private readonly Regex ringCodeSingleRegex = new Regex(@""); // Varies based on available fields, like Addtional Mould + private readonly Regex serialRegex = new Regex(@"Serial(.*?)"); + private readonly Regex systemRegex = new Regex(@"System"); + private readonly Regex titleRegex = new Regex(@"

(.*?)

"); + private readonly Regex trackRegex = new Regex(@"(?.*?)(?.*?)(?.*?)(?.*?)(?.*?)(?.*?)(?.*?)(?.*?)(?.*?)"); + private readonly Regex trackCountRegex = new Regex(@"Number of tracks(.*?)"); + private readonly Regex versionRegex = new Regex(@"Version(.*?)"); + private readonly Regex writeOffsetRegex = new Regex(@"Write offset(.*?)"); #endregion diff --git a/DICUI.Library/Web/RedumpAccess.cs b/DICUI.Library/Web/RedumpAccess.cs index 85b9271f..2d5e276a 100644 --- a/DICUI.Library/Web/RedumpAccess.cs +++ b/DICUI.Library/Web/RedumpAccess.cs @@ -55,9 +55,9 @@ namespace DICUI.Web #region Regexes - private Regex discRegex = new Regex(@"
"); - private Regex newDiscRegex = new Regex(@""); - private Regex tokenRegex = new Regex(@""); + private readonly Regex discRegex = new Regex(@""); + private readonly Regex newDiscRegex = new Regex(@""); + private readonly Regex tokenRegex = new Regex(@""); #endregion