Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
titleAvailability

This routine is available starting with SIL Engine™ 4.8.1.

Syntax

matchReplace(source, target, replacement);

Description

Excerpt

Uses a regex expression to find and replace text within a string.

Parameters

Parameter name

Type

Required

Description

SourceStringYesText string to be updated.
TargetStringYesRegex expression used to target text for replacement.
ReplacementStringYesReplacement text used to update the target text found by the regex expression.

Return type

String

Example 1

Code Block
string sourceText = "Oh, you are a Nigerian prince? Here is my credit card number 1111-2222-3333-4444.";

matchReplace(sourceText, "\d{4}-?\d{4}-?\d{4}-?\d{4}", "XXXX-XXXX-XXXX-XXXX");

Returns: "Oh, you are a Nigerian prince? Here is my credit card number XXXX-XXXX-XXXX-XXXX."

See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "jira_group_routine"
labelsjira_group_routine