Replace by Regular Expression

Logic Name

Replace by Regular Expression

Function

Replaces the input string by regular expression and returns the result.

Data Types

Location Type
The first input handler String
Logic output String
lightbulbRefer to "Logic Specifications" for details.

Properties

Category Property Description
Required String before replacement(regular expression pattern) Specify the pattern of string to replace.
Required String after replacement Specify the string to replace with.
Comment Comment The comment will also be output to the specifications.It does not affect the conversion process.

Function Details

Regular expression pattern

The available regular expression pattern is in accordance with java.util.regex.Pattern class of Java.
For details, refer to "Java(TM) Platform, Standard Edition 8 API Specification"(the URL below).(http://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html)

Regular Expression Reference

Reference notation Meaning
^ Beginning of line
$ End of line
. Any single character except newline
[] Any single character enclosed with[]
[^] Any single character not enclosed with[]
* Repeats the previous character for 0 time or more.
+ Repeats the previous character for once or more.
? 0 or 1 of the previous character
{a} Repeats the previous character for exactly "a" times.
{a,} Repeats the previous character for "a" or more than "a" times.
{a,b} Repeats the previous character for "a" to "b" times.
| Alternative operator(OR)

Logic Sample

Mapping Definition

Logic Settings and Processing Result

The logic converts product code to "*".
Property Settings
Property Setting
String before replacement(regular expression pattern) [A-Z]{3}-[0-9]{3}
String after replacement ***-***
Input Data
Sample A(ACE-036)
Sample B(KMO-147)
Sample C(VXZ-258)
Result Data
Sample A(***-***)
Sample B(***-***)
Sample C(***-***)