apg-exp also uniquely features two modes of back referencing. "Universal mode" is the equivalent of standard regex back referencing.1 However, a new "parent mode" has been introduced here. Among other things, it can be used with recursion (nested pairs) to match named, opening and closing HTML tags. An example of this can be found here.
Other features of APG greatly enhance the power of apg-exp. Especially check out,
- UDTs for hand-written code to match that special, difficult phrase.
- Abstract Syntax Tree (AST) for complex translations of the matched phrases.
- The APG trace for pattern syntax debugging.
- Many more features. See the README file and the complete user's guide.
Don't miss the tutorial on sitepoint.com. It will walk you through the basics from simple to some fairly sophisticated pattern matching of nested, paired parentheses and other brackets. It's all laid out for you with nine (9), hands-on, CodePen examples.