Attribute Parser Q not able to Solve - Please Help

I am not able to solve this Q:-

https://www.hackerrank.com/challenges/attribute-parser/problem

Can somebody help me in solving this Q.