If you have any other control group (eg. control group with all Nexuses) you could use it with Create Control Group # and Take Away Units
action (which is by default done with alt+#) to achieve this.
So for example, lets say you have all Nexuses on the 5th control group and some Stalkers on the 1st. You could perform sequence of: 5, ctrl+1, alt+5. So you would select all the Nexuses, then assign them to the 1st group (while replacing the Stalkers) and finally assign them to the 5th group, while removing them from all other groups.
You could also do 5, alt+1, alt+5 which would be a little bit easier to perform fast since you would only need to hold alt, without touching ctrl.