replace(a, b, c, d)


Replace every occurrence of b in the text a with the replacement 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) true if search and replace string 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