Endpoint
POST https://yas.sh/api/v1/tools/regex-tester
Request Header
Content-Type: application/json
cURL
curl -X POST "https://yas.sh/api/v1/tools/regex-tester" \
-H "Content-Type: application/json" \
-d '{"pattern":"(\\w+)@(\\w+)","text":"hello there world","flags":"g"}'JavaScript
const res = await fetch("https://yas.sh/api/v1/tools/regex-tester", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"pattern": "(\\w+)@(\\w+)",
"text": "hello there world",
"flags": "g"
}),
});
const data = await res.json();Python
import requests
r = requests.post("https://yas.sh/api/v1/tools/regex-tester", json={"pattern":"(\\w+)@(\\w+)","text":"hello there world","flags":"g"})
data = r.json()Success response
{ "slug": "regex-tester", "count": 2, "truncated": false, "result": [{ "match": "o t", "index": 4 }, ...] }Test a regex against a string (ReDoS-guarded, max 100 matches).