Profiles.Framework.Utilities.SessionManagement.IsBot C# (CSharp) Method

IsBot() private static method

private static IsBot ( string userAgent ) : bool
userAgent string
return bool
        private static bool IsBot(string userAgent)
        {
            if (userAgent != null)
            {
                foreach (string bot in BotUserAgents)
                {
                    if (new Regex(@"\A" + new Regex(@"\.|\$|\^|\{|\[|\(|\||\)|\*|\+|\?|\\").Replace(bot, ch => @"\" + ch).Replace('_', '.').Replace("%", ".*") + @"\z", RegexOptions.Singleline).IsMatch(userAgent))
                    {
                        return true;
                    }
                }
            }
            return false;
        }