You can turn that into choroba-s hashy structure using Data::Rmap
In reply to Re^3: Help with regular expression by Anonymous Monk in thread Help with regular expression by ng