Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-911

ReplaceText, with default configuration, will cause the replacement to be added twice

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.3.0
    • Extensions

    Description

      Currently, the default value for the Regular Expression property is (.*) which is intended to match any text. However, due to the way that the regular expression is interpreted, it first matches the entire content of the FlowFile and then again matches 0 characters at the end of the content (because .* will match 0 or more characters of any character).

      This results in the replacement value being added to the FlowFile twice. For example, if the replacement value is "Hello World", the output FlowFile will contain the text "Hello WorldHello World".

      We should instead change the regex pattern to (^.*$) to in order to ensure that we do not duplicate the output

      Attachments

        1. 0001-NIFI-911.patch
          6 kB
          Matt Gilman

        Activity

          People

            mcgilman Matt Gilman
            markap14 Mark Payne
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: