[
https://issues.apache.org/jira/browse/NIFI-14363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pierre Villard updated NIFI-14363:
----------------------------------
Fix Version/s: 2.4.0
Resolution: Fixed
Status: Resolved (was: Patch Available)
> Add a replaceByPattern expression language function
> ---------------------------------------------------
>
> Key: NIFI-14363
> URL: https://issues.apache.org/jira/browse/NIFI-14363
> Project: Apache NiFi
> Issue Type: New Feature
> Components: Core Framework
> Reporter: Pierre Villard
> Assignee: Pierre Villard
> Priority: Major
> Fix For: 2.4.0
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> *replaceByPattern*
> {*}Description{*}:
> Returns a string based on the provided mapping rule in order to replace the
> subject to another string. If the subject is not covered by the mapping rule,
> then the subject is returned.
> {*}Subject Type{*}: String
> {*}Argument{*}:
> - {_}mapping rule{_}: The mapping rule is a comma separated list of K:V
> where K may be a regular expression and V is the string to return in case K
> matches the subject. Examples: 'abc:xyz,foo:poo' and
> 'att[0-4]:low_range,att[5-9]:high_range,.*:other'
> {*}Return Type{*}: String
> {*}Examples{*}:
> If we have an attribute named "str" with the value "abc", then the following
> Expressions will result in the following values:
>
> |Expression|Value|
> |`${str:replaceByPattern('abc:xyz,foo:poo')}`|`xyz`|
> |`${str:replaceByPattern('foo:poo')}`|`abc`|
> |`${str:replaceByPattern('a.c:xyz,.*:foo')}`|`xyz`|
--
This message was sent by Atlassian Jira
(v8.20.10#820010)