A toggle command can be used as follows:
toggle
toggle n
toggle >hotspot y
toggle >hotspot
toggle @location>hotspot n
toggle @location>hotspot
my regex at the moment is the following:
^toggle(?>\s(?>@(?'location'\w+))?(?>>(?'hotspot'\w+))?)?(?>\s(?'value'n|y))?$
this one however allows the following strings to match:
toggle @location
toggle @location n
I would like to allow the named group "location" (prefixed by "@") only if the named group "hotspot" (prefixed by ">") matches.