replace-text
Replaces part of a text value with different text.
Searches a text value for a specific pattern (text or regular expression), and replaces one or all matches with a replacement text. The pattern can be a text or a regular expression. If pattern is a text, only the first occurrence will be replaced. If pattern is RegEx, all occurrences will be replaced.
Arguments
Inputs:
text
: Text containing a portion to be replaced.
pattern
: The text or a regular expression to be replaced.\nRegular expressions must be wrapped with /
character (e.g. /.*/
replacement
: The text that replaces the substring specified by the specified pattern
parameter. If unspecified, matches will be replaced with a blank text (i.e. \\"
).
Output:
text
: The text with specified pattern(s) replaced by the defined replacement.
Last updated