bottom

Pattern Search and Replace

Attention: open in a new window. PDF 

User Rating: / 4
PoorBest 

This generation rule allows to replace in a source string value every substring matching a pattern (regular expression or regular string) by another string that can be built from the string that matched the pattern.

StringReplace

The rule can be configured with multiple patterns and replacement expressions. You can chose to stop the processing at the first match or continue processing of each pattern. Therefor the order of the patterns in the list can have an impact on the source string transformations.

There is 3 types of pattern replacement:

  • RegExp : means that the pattern is a regular expression and replacements will occur on each match. In the replacement value you can refer to part of the matched pattern using $1, $2 etc. SeBoost Regex format for more information on how it works.
  • String : means that the pattern should exatly matches the source string to perform the replacement.
  • Substring : means that the pattern can match any number of substrings in the source string and the replacement will occur on each of those macthes.

For example, if you check the string : I have a blue car with the pattern (blue)|(red)|(yellow) and the replacement It's about color $1, then the produced value will be It's about color blue.

Add comment


Security code
Refresh