Well this is a hard one, well if you know how to do a search method for directories, you probably could do that for registry too.
My registry module has a function that returns all subkeys in an array so you could have a go for it