Regular expressions and are popular matching patterns in strings. What similar handy languages exist to match other data structures? I know XPath for XML trees, but I have not seen use of it for other tree structures (e.g. JSON objects, S-Expressions, or nested record structures in your programming languages). I have heard of SNOBOL patterns and Perl6 grammars, maybe someone can point me to concrete examples and and documentation of pattern matching data structures? For graph structures my only idea is graph patterns in Notation3 and SPARQL (limited to RDF graphs), and for patterns in multi-dimensional arrays I don't know anything.
Regular expressions seem to be the only pattern matching language that is used in most programming languages, but matching languages for non-strings are much less common. I cannot believe that the reason is the dominance of strings over other structures like arrays, lists, records, tables, trees, and graphs.