public static IEnumerable <IRecordedMessage> InTopic(this IEnumerable <IRecordedMessage> messages, string topicNamePattern)
 {
     if (RosNameRegex.IsGlobalPattern(topicNamePattern))
     {
         return(InGlobalTopic(messages, topicNamePattern));
     }
     else
     {
         return(InRelativeTopic(messages, topicNamePattern));
     }
 }
        public static bool IsInTopic(this IRecordedMessage message, string topicNamePattern)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            if (RosNameRegex.IsGlobalPattern(topicNamePattern))
            {
                return(IsInGlobalTopic(message, topicNamePattern));
            }
            else
            {
                return(IsInRelativeTopic(message, topicNamePattern));
            }
        }