2 Commits d134b70dc4 ... 4bfeead73d

Author SHA1 Message Date
  yuanrf 4bfeead73d Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop 1 week ago
  yuanrf e5079c5edb ++ 1 week ago
1 changed files with 8 additions and 5 deletions
  1. 8 5
      OASystem/OASystem.Api/Controllers/GroupsController.cs

+ 8 - 5
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -11531,14 +11531,17 @@ FROM
 
             // 构造正则表达式,匹配形如 [++]内容[++] 的部分
             string pattern = $@"{Regex.Escape(tag)}(.*?){Regex.Escape(tag)}";
-            MatchCollection matches = Regex.Matches(input, pattern);
 
-            foreach (System.Text.RegularExpressions.Match match in matches)
+            // 添加 RegexOptions.Singleline 选项使 . 匹配包括换行符在内的所有字符
+            MatchCollection matches = Regex.Matches(input, pattern, RegexOptions.Singleline);
+
+            string[] strValueArr = new string[1];
+            foreach (Match match in matches)
             {
-                // 提取匹配的内容(在两个标记之间的部分)
-                results.Add(match.Groups[1].Value);
+                var strValue = match.Groups[1].Value;
+                strValueArr = Regex.Split(strValue, @"\r\n|\n");
             }
-
+            results.AddRange(strValueArr.Where(x => !string.IsNullOrWhiteSpace(x)));
             return results;
         }