Regex for tree structures?
TSurgeon and Tregex from Stanford is capable of doing that. You can download the library from http://nlp.stanford.edu/software/tregex.shtml
I don't know a general purpose langugae that can do that, but it seems to me that you are looking for something like XPath.