Simple, regexp-based tree finder

Will highly probably find use in @akarol 's snapshot code to properly search for active snapshot or to look for specific snapshot.