Not as you're specifying it. The list of valid commands could be stored in a variable (as you show), however, you can't have a wildcard as the token match...While it doesn't have to be $1, in your case that is what I would suggest, since you're wanting to check the triggering command (which is located in $1)