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

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

Commit d46ee938db2f10565d15b5fae933ef20311ae41f in nifi's branch 
refs/heads/main from Pierre Villard
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=d46ee938db ]

NIFI-14363 Added replaceByPattern Expression Language function (#9799)

Signed-off-by: David Handermann <[email protected]>

> 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
>          Time Spent: 0.5h
>  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)

Reply via email to