/
matchReplace
matchReplace
Description
Uses a regex expression to find and replace text within a string.
Parameters
Return Type
String
Examples
Example 1
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."
Example 2
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
Peacock
, multiple selections available,
Related content
substring
substring
Read with this
Predefined structure types reference
Predefined structure types reference
Read with this
String Functions
String Functions
Read with this
matchReplace
matchReplace
More like this
matchReplace
matchReplace
More like this
replace
replace
More like this
Need support? Create a request with our support team.
Copyright © 2005 - 2025 Appfire | All rights reserved.