Reemplazar con expresión regular
regex-replaceReemplaza coincidencias de una expresión regular ($1, $) en un contexto vm con límite de 50 ms y resultado máx. de 1.000.000 caracteres. Cuándo: hay que transformar, comparar o medir un texto con exactitud y no por aproximación. No para: escapar una cadena literal para usarla dentro de una expresión regular (regex-escape). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Replaces regex matches ($1, $, $&, $` and $' supported) in a vm context with a 50 ms limit and a 1,000,000-character result cap. Without the g flag only the first match is replaced. When: text has to be transformed, compared or measured exactly instead of approximated. Not for: escaping a literal string so it can be embedded in a regular expression and match itself exactly (regex-escape). [EN completo / full EN: inputSchema.description]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Subject text (string; required). | |
| flags | No | Flags from dgimsuyv (string; optional; default ""; up to 8 chars; pattern ^[dgimsuyv]*$). | |
| pattern | Yes | JavaScript regular expression source (no slashes) (string; required; at least 1 chars; up to 500 chars). | |
| replacement | Yes | Replacement string (string; required; up to 10000 chars). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | ||
| replacements | No |