Yaircc.Net.IRC.AwayMessage.TryParse C# (CSharp) Method

TryParse() public method

Attempts to parse the input specified by the user into the Message.
public TryParse ( string input ) : ParseResult
input string The input from the user.
return ParseResult
        public override ParseResult TryParse(string input)
        {
            string pattern = @"/away(\s+(?<message>.+))?";
            Regex regex = new Regex(pattern, RegexOptions.IgnoreCase);
            Match match = regex.Match(input);

            if (match.Success)
            {
                if (match.Groups["message"].Success)
                {
                    this.TrailingParameter = match.Groups["message"].Value;
                }
            }

            return new ParseResult(true, string.Empty);
        }