Test a regex against one or many inputs, safely. Send {pattern, flags?, input|inputs[], mode?}: 'match' returns the first match + capture groups, 'matchAll' every match, 'replace' the rewritten string (needs {replacement}). A mandatory ReDoS guard statically rejects catastrophic patterns (nested quantifiers, `.*.*$`, backrefs) BEFORE running — on Workers no timeout can stop a runaway regex. For agents that generate and dry-run regexes.