Produced some untested code to translate target patterns into regular expressions and to match targets against these, binding variable attributes while matching. Names of variable attributes are stored as regex group names.