The myPatterns/Java library allows matching any Java object with a pattern written in any custom notation. However, there is a default, predefined, JSON-based notation, that is demonstrated on this page.
With respect to the strictly complying JSON syntax, we here admit a relaxed JSON syntax, in which simple field names can be written without quotes, and strings may be delimited by either single or double quotes.
The default matching notation is JSON patterns, an extension of (relaxed) JSON for filtering and decomposing data, in which:
Note that the resulting substitution maps named variables to their values, and capturing groups (within regexes) to their matched substrings. Capturing groups are numbered starting from zero (if you want the substring matched by the whole regex as group number zero, enclose the whole regexp in a capturing group).