pattern matcher for records.