mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add tokenization code to filter group
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using SabreTools.Models.Metadata;
|
||||
|
||||
namespace SabreTools.Core.Filter
|
||||
@@ -145,6 +146,19 @@ namespace SabreTools.Core.Filter
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tokenize an input string to parse into a filter group
|
||||
/// </summary>
|
||||
private static string[] Tokenize(string? input)
|
||||
{
|
||||
// Null inputs are ignored
|
||||
if (input == null)
|
||||
return [];
|
||||
|
||||
// Split the string into parseable pieces
|
||||
return Regex.Split(input, @"(\(|[a-zA-Z._:!&|""]+|\))");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user