语言
/v1/regex/replace
将正则表达式模式应用于字符串,并用指定的替换项替换所有匹配项。 支持替换字符串中捕获组的反向引用($1、$2)。
The regular expression pattern to match.
Regex flags (e.g., "g" for global replacement).
The input string to perform replacement on.
The replacement string. Use $1, $2 for capture group backreferences.
curl -X POST https://api.botoi.com/v1/regex/replace \ -H "Content-Type: application/json" \ -d '{"pattern":"(\\d{4})-(\\d{2})-(\\d{2})","flags":"g","testString":"Event date: 2026-03-26","replacement":"$2/$3/$1"}'
使用捕获组反向引用将所有 ISO 日期 (YYYY-MM-DD) 转换为美国格式 (MM/DD/YYYY) 或任何其他格式。
在共享之前,将日志文件中的信用卡号、SSN 或 API 密钥替换为“****”等屏蔽值。
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.