in src/Epam.Kafka.PubSub/Subscription/Options/SubscriptionOptionsExtensions.cs [111:131]
private static IEnumerable<Match> SplitTopics(this SubscriptionOptions options, Regex regex)
{
if (options == null) throw new ArgumentNullException(nameof(options));
if (options.Topics == null) throw new ArgumentException($"{nameof(options.Topics)} is null", nameof(options));
string[] split = options.Topics.Split(TopicsSeparator, StringSplitOptions.RemoveEmptyEntries);
foreach (string item in split)
{
Match match = regex.Match(item.Trim());
if (match.Success)
{
yield return match;
}
else
{
throw new ArgumentException($"Topic value '{item}' not match '{regex}'.");
}
}
}