Find matching rules for an element