I have to parse the below string into three groups, Command, Target, Args. Both Targets and Args are independently optional.
/ping@mybot arg1 arg2
I have created a regex with the valuable help of regexr.com, and I get the correct matches here.
/(?<Command>[\w]*)+(?:@(?<Target>[\S]*)+)?(?<Args>[\s\S]*)?
However when I try and plug this into C#, I do not get any Matches, what could I have messed up here? I am @" escaping the string to avoid escaping issues:
var match = Regex.Match(cmd, @"/(?<Command>[\w]*)+(?:@(?<Target>[\S]*)+)?(?<Args>[\s\S]*)?");
Does C# require a different set of characters for it's regex?

