Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8194965

Regex: Capture Trees and Recursive Regular Expressions should be supported

XMLWordPrintable

      A DESCRIPTION OF THE REQUEST :
      Recursive constructs ( that frequently appear in mathematics or in programming languages ) can't be parsed with java.util.regex at the moment.
      That's why Recursive Regular Expressions should be supported. It should then also be possible to inspect every group matched during the previous match operation (not just the last one) and in such a way that reflects the hierarchical nature of the groups.



      JUSTIFICATION :
      The tree-like data-structure that saves all the groups captured during the previous match operation could be called a Capture Tree.

      What a Capture Tree is and what it is good for, is explained in more detail here https://github.com/florianingerl/com.florianingerl.util.regex#capture-trees .

      A more complicated example for the usefulness of Capture Trees is given here:
      https://github.com/florianingerl/com.florianingerl.math.termcalculator


      ---------- BEGIN SOURCE ----------
      A test case can be found here:
      https://github.com/florianingerl/com.florianingerl.util.regex#capture-trees .
      ---------- END SOURCE ----------

            sherman Xueming Shen
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: