Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-658

Escape Meta-characters like $, ^ in Regular Expression provided in pattern statement

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 6630

    Description

      Pattern statement (RFC 6020, Section 9.4.6) accepts regular expression defined by XSD Schema Spec (https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#regexs) which doesn't have meta-characters like ^ and $.

      XSD Schema definition of RegExp expects to match the entire string and so Yangtools is correctly returning the pattern defined in Yang enclosed within ^ and $. But, it doesn't escape these characters if they are found inside the pattern value.

      Due to this issue, attempts to use PatternConstraint::getRegularExpression as is with Java Pattern/Matcher classes doesn't work as expected.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              reachme@kajasweb.com Kaja Mohideen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: