Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-5368

Braces without escaping in regexes throws error in recent perl versions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.18.0
    • None
    • None
    • Reviewed

    Description

       

      In perl v5.22, using a literal { in a regular expression was deprecated, and will emit a warning if it isn't escaped: {. In v5.26, this won't just warn, it'll cause a syntax error.

      Example: https://github.com/apache/pig/blob/e766b6bf29e610b6312f8447fc008bed6beb4090/test/e2e/pig/tests/cmdline.conf#L47  

      $ perl -e 'print "It matches\n" if "Hello World" =~ /World{abc}/'
      Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/World\{ <-- HERE abc}/ at -e line 1.
      
      $ perl -e 'print "It matches\n" if "Hello World" =~ /World\{abc}/'
      
      

       

      Attachments

        1. PIG-5368-1.patch
          15 kB
          László Bodor
        2. PIG-5368-1.addendum.patch
          16 kB
          László Bodor

        Activity

          People

            abstractdog László Bodor
            abstractdog László Bodor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: