Uploaded image for project: 'WINDUP - Red Hat Application Migration Toolkit'
  1. WINDUP - Red Hat Application Migration Toolkit
  2. WINDUP-2388

Pattern matching regexes not working properly

    XMLWordPrintable

Details

    Description

      See attached rule XML.

      In the `where` clause, I have a `matches` element with a `pattern` attribute with a regex inside. That regex uses a negative lookahead `(?! ... )` to match anything except for the text inside the lookahead. Negative lookaheads are supported by Java (as supported by the documentation)

      However, when I use the negative lookahead in the regex, it does not work. I won't match strings other than the string in the lookahead. If I put another type of expression (such as a simple string match), it works fine. I've also validated the expression works.

      Okay, so it looks like regex-based pattern matching in general is not working properly, as I've found multiple cases where it doesn't match when it should. See the updated `spring-version-check.rhamt.xml` attachment. Notice the regex in the `where` clause. There are artifacts that contain the file "spring-jdbc-3.1.2.RELEASE.jar" that should be being flagged by the rule, but the regex is not matching against the filename. I validated that the regex works properly here.

      Attachments

        Activity

          People

            Unassigned Unassigned
            RHN-GPS-wlaw Wheeler Law
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: