What is a general way to parse the trees in the Penn TreeBank for arbitrary patterns, e.g. perhaps I want all trees which have a plural subject and whose sister VP has a modal verb daughter.
Another example would be finding all trees which have a VP headed by some verb and which have a daughter PP headed by to. This isn't even a subtree match--it's only matching an incomplete part of the tree.
This doesn't seem very easy, because the trees are not regular structures but are presumably context-free (or even context-sensitive).
I thought about converting the trees to strings, but regex obviously doesn't not work for this. Regex is useful for finding whole (sub)trees, but I wish to find patterns among different phrases/nodes in the tree.