Implement amara3.uxml.treeutil.select_pattern