Refactored. Introduced Regex and Range matches for attributes.