replace(a, b, c, d)


This function replaces every occurrence of b in text a with text c. Search and replacement text can be specified as a regular expression. If no regular expression is used, newline and tabulator characters can be specified with \NL and \TAB.

Description of Parameters


Parameter

Description

a

Text.

b

Search text.

c

Replacement text.

d

(optional)Use true if the search and replace text is a regular expression. Default: false


Examples


Parameter a

Parameter b

Parameter c

Parameter d

Result

aaaa

a

1


1111

abcabc

abc

\TAB

false

(Two tabs.)

abcabc

abc

\CR\NL

false

(Two linebreaks.)

Firstname Surname

(\S+)\s+(\S+)

$2, $1

true

Surname, Firstname

Testphone: +49 (8158) 47-11

[^\+\d]


true

+4981584711