[ 
https://issues.apache.org/jira/browse/NIFI-911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14723869#comment-14723869
 ] 

ASF subversion and git services commented on NIFI-911:
------------------------------------------------------

Commit cd2e1424cb3ccd975d87193603669269899aac2a in nifi's branch 
refs/heads/master from [~mcgilman]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=cd2e142 ]

NIFI-911:
- Updating default value for Regex so it matches once (?s:^.*$) instead of 
twice (.*). Matching on .* results in matching for every character and then 
again for 0 characters.

> ReplaceText, with default configuration, will cause the replacement to be 
> added twice
> -------------------------------------------------------------------------------------
>
>                 Key: NIFI-911
>                 URL: https://issues.apache.org/jira/browse/NIFI-911
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>            Reporter: Mark Payne
>            Assignee: Matt Gilman
>              Labels: beginner, newbie
>             Fix For: 0.3.0
>
>         Attachments: 0001-NIFI-911.patch
>
>
> 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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to