You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

This function replaces the first substring matching the given regular expression with the given replacement.

Syntax
replaceFirst(text, regexp, replacement) #Output : Text
Examples
Parser expressionDescription
replaceFirst("Hello World", "l", "_")

This example returns the following text : "He_lo World"

Additional information

Parameters used in this function

ParameterInput (data type)Description
text

TEXT

Any given text.
regexp

TEXT

A valid regeular expression that grabs the substring to be replaced.
replacement

TEXT

This text will replace the substring found by the regexp.
Output

This function returns a TEXT

If you want to replace all matching occurrences with the replacement, have a look at the replaceAll() function.

replaceFirst("Hello World", "l", "_")replaceAll("Hello World", "l", "_")
"He_lo World""He__o World"