From 7fad80bae16eaa04bc21cc0f927772e1e34ae2f4 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 13 Aug 2023 13:32:52 +0300 Subject: [PATCH] 20230813-1 --- anbs_cp/Classes/TextFormatter.cs | 12 +++--------- anbs_cp/anbs_cp.csproj | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/anbs_cp/Classes/TextFormatter.cs b/anbs_cp/Classes/TextFormatter.cs index f7eeaa7..470fa0e 100644 --- a/anbs_cp/Classes/TextFormatter.cs +++ b/anbs_cp/Classes/TextFormatter.cs @@ -115,20 +115,14 @@ public static class TextFormatter /// /// Текст на проверку /// Шаблон - /// Параметры проверки в формате (можно игнорировать, по умолчанию: ) + /// Параметры проверки в формате (можно игнорировать, по умолчанию: ) /// Есть ли совпадения в тексте public static bool IsMatchRegExp (string text, string pattern, RegexOptions? options = null) { // Задаю настройки проверки регулярных выражений - RegexOptions regexOptions = options ?? RegexOptions.None; - - // Создаю класс для проверки выражения - Regex regex = new Regex(pattern, regexOptions); - - // Получаю совпадения - MatchCollection matches = regex.Matches(text); + RegexOptions regexOptions = options ?? RegexOptions.IgnoreCase; // Возвращаю результат - return matches.Count > 0; + return Regex.IsMatch(text, pattern, regexOptions); } } \ No newline at end of file diff --git a/anbs_cp/anbs_cp.csproj b/anbs_cp/anbs_cp.csproj index 83bb7c7..8210ecd 100644 --- a/anbs_cp/anbs_cp.csproj +++ b/anbs_cp/anbs_cp.csproj @@ -2,7 +2,7 @@ net7.0 - 2023.813.0 + 2023.813.1 Александр Бабаев Набор компонентов ANB Software Библиотека полезных методов языка C#