Hierarchical Ruby expression matcher