regex for tree searches