make build_regexp_for() useable for other attribute names (removed hard coded attribute_name 'matches')