public static string PluginName(this string message)
{
var pluginMatch = Regex.Match(message, @"\$(?<pluginName>[a-zA-Z]+)\s*");
if (!pluginMatch.Success)
{
throw new ArgumentException(string.Format("Missing plugin name in message '{0}'", message), "message");
}
return pluginMatch.Groups["pluginName"].Value;
}