[strings.regex-replace]

strings.regex-replace is a slot in the strings namespace, in Hyperlambda, the language of Magic Cloud. Replaces text using a regular expression, bounded by the execution deadline when set.

  • Value (text), required: Text to transform
  • Returns: Resolves to the string after applying the regular-expression replacement

Arguments

Required arguments come first, then the optional ones in the order they are declared.

Argument Type Required Description
unnamed child node string yes Regular expression pattern to match.
unnamed child node string yes Replacement text.

Guide: How to use [strings.regex-replace]

JSON declaration

This is the complete declaration of strings.regex-replace, as the running system describes it. It is also published as slot.json.

JSON declaration
{
  "name": "strings.regex-replace",
  "description": "Replaces text using a regular expression, bounded by the execution deadline when set",
  "signature": {
    "input": {
      "kind": "text",
      "description": "Text to transform",
      "required": true,
      "mode": "ValueOrExpression"
    },
    "children": [
      {
        "type": "string",
        "kind": "regex-pattern",
        "description": "Regular expression pattern to match",
        "required": true,
        "mode": "ExecutableLambda",
        "cardinality": "ExactlyOne",
        "role": "SourceExpression",
        "evaluation": "EvalSelf",
        "projection": "Value"
      },
      {
        "type": "string",
        "kind": "character-replacement",
        "description": "Replacement text",
        "required": true,
        "mode": "ExecutableLambda",
        "cardinality": "ExactlyOne",
        "role": "SourceExpression",
        "evaluation": "EvalSelf",
        "projection": "Value"
      }
    ],
    "output": {
      "mode": "Value",
      "kind": "text",
      "description": "Resolves to the string after applying the regular-expression replacement"
    }
  }
}

← strings.mixin all strings.* slots strings.replace →