string_replaceRegExp

Replaces regular expression matches in a string.

Target function

Signature

1string_replaceRegExp(input, -find::string, -replace::string, -ignoreCase= ?)

Replaces regular expression matches in a string.

string_replaceRegExp is a global callable that can be used wherever an expression is valid. string_replaceRegExp uses the regular-expression surface for pattern matching. Keep patterns small, name the intent in nearby code, and test captures separately from replacement strings.

Parameters

input
Required value. Supply input positionally unless the signature shows a keyword form.
-find
Required value of type string. Supply -find by keyword, keeping the leading hyphen in the call.
-replace
Required value of type string. Supply -replace by keyword, keeping the leading hyphen in the call.
-ignoreCase
Optional value. Supply -ignoreCase by keyword, keeping the leading hyphen in the call.

Examples

Basic call

1string_replaceRegExp('a1 b2', -find='[0-9]', -replace='#')
The example shows the normal call shape. Adapt variable names, validation, and surrounding error handling to the context.