myPatterns is a flexible library for pattern matching in Java and JavaScript programs.
Pattern matching is a well-known programming mechanism for recognizing data having a particular shape (or "matching" a particular "pattern"), and at the same time binding some variables occurring in the pattern to some sub-structures of those instances.
The standard matching implementations included in Java and in JavaScript are limited to pattern matching of strings using regular expressions. Regexps are a very powerful matching notation, directly built into the JavaScript language, and implemented in Java by the standard library java.util.regex.MyPatterns implements an even more general form of pattern matching: