Files
jube-fork/Jube.Case/Tokenisation.cs
richard-churchman 0511a3ba82 Refactored Case Status automation and shared Case functionality:
* Extracted Case Notification and HTTP Web Hook functionality into a shared Jube.Case library for use across Jube.App and Jube.Engine.
* Added the new Jube.Case library to the Jube.App Docker Compose configuration.
* Cleaned up classes moved to Jube.Case, converting to static classes or methods where appropriate.
* Implemented Case Status automation within the asynchronous background Case Creation process, including upward status classification.
2026-02-09 09:38:28 +02:00

41 lines
1.4 KiB
C#

/* Copyright (C) 2022-present Jube Holdings Limited.
*
* This file is part of Jube™ software.
*
* Jube™ is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* Jube™ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License along with Jube™. If not,
* see <https://www.gnu.org/licenses/>.
*/
namespace Jube.Case
{
using System.Text.RegularExpressions;
public static class Tokenisation
{
public static List<string> ReturnTokens(string message)
{
var matches = Regex.Matches(message, @"\[@(.*?)\]");
var returnList = new List<string>();
foreach (var match in matches)
{
var key = match.ToString()?.Remove(0, 2);
if (key == null)
{
continue;
}
key = key.Remove(key.Length - 2, 2);
returnList.Add(key);
}
return returnList;
}
}
}