Replace Substring V2

Replaces text matching a pattern, with the added ability to replace matches with an empty string. Use it when you also need to strip text out entirely.

What it does

  • Finds matches of a string or regular-expression pattern in the original text.
  • Replaces them with the replacement value, or removes them entirely.
  • Returns the resulting text.

Inputs

NameTypeDescription
Original TextStringOriginal text
PatternStringString or regex to match
ReplacementStringString to replace pattern by. Use DG_REPLACE_BY_EMPTY to replace by the empty string.
Case SensitiveBooleanWhether the match is case sensitive
Replace GloballyBooleanWhether to replace all matched values

Outputs

NameTypeDescription
SuccessBooleanWhether the replacement was successful
Result ValueStringResult value of the replacement

Notes

  • Set the replacement to DG_REPLACE_BY_EMPTY to delete the matched text.
  • Turn on Replace Globally to replace every match rather than only the first.