I'm having the same issue.
The following works great in the NiFi ReplaceText Processor
Flowfile Content:
US0706003247984600Z1Z000123371K
US0706003247984600Z1Z000125491K
US0706003247984600Z1Z000125596K
Search Value:
(.{2})(?:.{4})(.{6})(.{2})(.{4})(.{6})(.{6})(.{1})
Replacement Value: {col_foo1:$1,col_foo3:$2,col_foo4:$3,col_foo5:$4,col_foo6:$5,col_foo7:$6,col_foo8:$7},
Output: {col_foo1:US,col_foo3:003247,col_foo4:98,col_foo5:4600,col_foo6:Z1Z000,col_foo7:123371,col_foo8:K},
{col_foo1:US,col_foo3:003247,col_foo4:98,col_foo5:4600,col_foo6:Z1Z000,col_foo7:125491,col_foo8:K},
{col_foo1:US,col_foo3:003247,col_foo4:98,col_foo5:4600,col_foo6:Z1Z000,col_foo7:125596,col_foo8:K},
however
I need to store the Search Value in an Attribute (e.g. search.value) and the Replacement Value in an Attribute (e.g. replace.value), which will be passed in a via a configuration file.
Flowfile Content:
US0706003247984600Z1Z000123371K
US0706003247984600Z1Z000125491K
US0706003247984600Z1Z000125596K
Search Value: ${search.value}
search.value Attribute: (.{2})(?:.{4})(.{6})(.{2})(.{4})(.{6})(.{6})(.{1})
Replacement Value: ${replacement.value}
replacement.value Attribute: {col_foo1:$1,col_foo3:$2,col_foo4:$3,col_foo5:$4,col_foo6:$5,col_foo7:$6,col_foo8:$7},
Output: US0706003247984600Z1Z000123371K
US0706003247984600Z1Z000125491K
US0706003247984600Z1Z000125596K
which appears to indicate that the regex content of each of the Attribute values is not being evaluated properly.
Any ideas are greatly appreciated.