Up: Component summary Component

SearchReplace

Transforms the given file by replacing certain string with new values. The format of search replace rules follows the syntax of regular expressions used in Java. Each rule consists of two patterns: the search pattern(s) and the substituent pattern. Note: A group backreference to keys ex. "(\\S+).*" is done with "$1".

Version 1.1
Bundle tools
Categories Convert
Specialties generic
Authors Marko Laakso (Marko.Laakso@Helsinki.FI)
Issue tracker View/Report issues
Source files component.xml
Usage Example with default values

Type parameters (generics)

Inputs

Name Type Mandatory Description
in T (generic) Mandatory Source file to be modified
rules Properties Optional A set of search keys

Outputs

Name Type Description
out T (generic) Modified target file

Parameters

Name Type Default Description
fixed boolean false Disable regular expressions and use keys as such.
key00 string "" Search key 0
key01 string "" Search key 1
key02 string "" Search key 2
key03 string "" Search key 3
key04 string "" Search key 4
key05 string "" Search key 5
key06 string "" Search key 6
key07 string "" Search key 7
key08 string "" Search key 8
key09 string "" Search key 9
value00 string "" Replacement 0
value01 string "" Replacement 1
value02 string "" Replacement 2
value03 string "" Replacement 3
value04 string "" Replacement 4
value05 string "" Replacement 5
value06 string "" Replacement 6
value07 string "" Replacement 7
value08 string "" Replacement 8
value09 string "" Replacement 9

Test cases

Test case Parameters IN
in
IN
rules
OUT
out
case1 properties in (missing) out

key01 =\\$\\{name\\},
value01=Marko Laakso,
key02 =\\$\\{age\\},
value02=12,
key03 =\\$\\{age.unit\\},
value03=a

case2 (missing) in rules out
case3 properties in (missing) out

fixed =true,
key01 =${name},
value01=Marko Laakso,
key02 =${age},
value02=12,
key03 =${age.unit},
value03=a


Generated 2019-02-08 07:42:19 by Anduril 2.0.0