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

RegExp regression

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • 8
    • 8
    • core-libs
    • None
    • b89
    • Verified

    Description

      The following testcase used to capture groups, it doesn't capture anymore.

      var semver = "\\s*[v=]*\\s*([0-9]+)" // major
                 + "\\.([0-9]+)" // minor
                 + "\\.([0-9]+)" // patch
                 + "(-[0-9]+-?)?" // build
                 + "([a-zA-Z-+][a-zA-Z0-9-\.:]*)?" // tag
        , exprComparator = "^((<|>)?=?)\s*("+semver+")$|^$";
        var validComparator = new RegExp("^"+exprComparator+"$");
        
        // Matches should be: >=0.6.0-,>=,>,0.6.0-,0,6,0,,-
        print("Matches " + ">=0.6.0-".match(validComparator));

      Attachments

        Activity

          People

            hannesw Hannes Wallnoefer
            jfdenise Jean-Francois Denise (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: