Steve Lawrence created DAFFODIL-2001:
----------------------------------------

             Summary: Regex patterns not validated correctly with newer 
versions of Java
                 Key: DAFFODIL-2001
                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2001
             Project: Daffodil
          Issue Type: Bug
          Components: Front End
    Affects Versions: 2.3.0
            Reporter: Steve Lawrence
             Fix For: 2.3.0


According to the DFDL spec, only regex features available in both Java 7 and 
ICU are allowed, and other features should cause an SDE. To check this, we 
simply compile a regex with both Java and ICU, and if either fails then we 
assume the regex is invalid, either because it actually is invalid or it uses a 
feature that the DFDL spec does not allow.

However, newer versions of Java support newer regex capabilities, so some 
regex's that are invalid in Java 7 are valid in later Java versions. This means 
that when using a new version of Java, a regex could be allowed that isn't 
portable and isn't valid according to the DFDL spec.

So we should manually inspect regular expressions rather for validity than 
relying on the Java/ICU regex compilers to determine if a regular expression is 
DFDL compliant and issue an error, or issue a warning that the regex may 
contain non-portable features, perhaps controlled by a tunable.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to