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.0.1113.

Syntax

matchReplace(source, target, replacement);

...

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.

...

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

Example 2

Removes all HTML tags from a block of text.

Code Block
string HTML = "<p>Geckos are a group of usually small, usually <strong style='color: blue;'>nocturnal</strong> lizards. They are found on every continent except Australia.</p>";
            
return matchReplace(HTML, "<[^>]*>", "");

Returns: Geckos are a group of usually small, usually nocturnal lizards. They are found on every continent except Australia.

See also

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