Regex.replace

Regex.replace

Regex.replace

Function

Replace text using the current regular expression.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
textAnyNo''The text to process.
toAnyNo''The replaced content.

Return value

TypeDescription
StringReturns the replaced string.

Example

Notes

  • Replaces all matches if flags contains g; otherwise only replaces the first match.