{"id":"regex-replacement-check","version":"1.0.0","description":"Checks an exact claimed bounded regex replacement and reports the first differing UTF-16 index.","supported_operations":["check regex replacement claim","validate replaced text","compare regex substitution","verify replacement output","find first replacement mismatch","check dollar replacement tokens"],"unsupported_operations":["execute arbitrary regular expressions","repair an incorrect replacement"],"semantics":["Patterns use the documented RE2-compatible linear subset; indices are ECMA-262 UTF-16 indices.","Replacement tokens $$, $&, $`, and $' follow ECMA-262 replacement substitution; other dollar forms are literal.","Replacement construction stops before the declared UTF-8 result-size bound is crossed; discrepancy values are complete Unicode scalar values containing the differing code unit."],"limits":{"max_input_bytes":65536,"max_pattern_bytes":256,"max_claim_items":4096,"max_matches":4096,"max_result_bytes":262144},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"properties":{"text":{"type":"string","maxLength":65536},"pattern":{"type":"string","minLength":1,"maxLength":256},"flags":{"type":"string","maxLength":2},"replacement":{"type":"string","maxLength":65536},"claimed":{"type":"string","maxLength":262144}},"required":["text","pattern","flags","replacement","claimed"]},"output_schema":{"type":"object","additionalProperties":false,"properties":{"valid":{"type":"boolean"},"reason":{"type":"string"},"discrepancy":{"type":"object","additionalProperties":false,"properties":{"path":{"type":"string"},"index":{"type":"integer","minimum":0},"expected":{"type":["string","null"]},"actual":{"type":["string","null"]}},"required":["path","index","expected","actual"]},"reference_version":{"type":"string"}},"required":["valid","reference_version"]},"examples":[{"input":{"text":"a1b2","pattern":"\\d","flags":"","replacement":"X","claimed":"aXbX"},"output":{"valid":true,"reference_version":"RE2-syntax-2024-07; ECMA-262-2025-index-and-replacement"}},{"input":{"text":"cat","pattern":"a","flags":"","replacement":"o","claimed":"cut"},"output":{"valid":false,"reason":"claim_mismatch","discrepancy":{"path":"claimed","index":1,"expected":"o","actual":"u"},"reference_version":"RE2-syntax-2024-07; ECMA-262-2025-index-and-replacement"}}],"execute_url":"/v1/tools/regex-replacement-check/versions/1.0.0/execute"}