allow variables to be set based on subpatterns