diff --git a/src/libse/Common/Utilities.cs b/src/libse/Common/Utilities.cs index aada8425eb..ea95223fdc 100644 --- a/src/libse/Common/Utilities.cs +++ b/src/libse/Common/Utilities.cs @@ -25,7 +25,7 @@ public static class Utilities /// public static readonly char[] NewLineChars = { '\r', '\n' }; - private static readonly Regex NumberSeparatorNumberRegEx = new Regex(@"\b\d+[\.:;] \d+\b", RegexOptions.Compiled); + private static readonly Regex NumericSeparatorRegex = new Regex(@"\b\d+(?>[ ]+[\.:;][ ]*|[ ]*[\.:;][ ]+)\d+\b", RegexOptions.Compiled); private static readonly Regex RegexIsNumber = new Regex("^\\d+$", RegexOptions.Compiled); private static readonly Regex RegexIsEpisodeNumber = new Regex("^\\d+x\\d+$", RegexOptions.Compiled); private static readonly Regex RegexNumberSpacePeriod = new Regex(@"(\d) (\.)", RegexOptions.Compiled); @@ -2551,12 +2551,12 @@ public static string RemoveUnneededSpaces(string input, string language) text = text.Replace(" . ", ". "); } - var numberSeparatorNumberMatch = NumberSeparatorNumberRegEx.Match(text); + var numberSeparatorNumberMatch = NumericSeparatorRegex.Match(text); while (numberSeparatorNumberMatch.Success) { var spaceIdx = text.IndexOf(' ', numberSeparatorNumberMatch.Index); text = text.Remove(spaceIdx, 1); - numberSeparatorNumberMatch = NumberSeparatorNumberRegEx.Match(text); + numberSeparatorNumberMatch = NumericSeparatorRegex.Match(text); } return text;