Allow matching of hyphenated attribute names
Refactored and tests added