Test regular expressions against any text in real-time. View all matches, capture groups, and positions. JavaScript regex syntax.
## Test regex with curl
curl -X POST https://apitoolkit.pro/api/v1/regex \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"pattern":"(\\w+)@(\\w+)\\.\\w+","flags":"gi","input":"hello@example.com"}'
## JavaScript
const res = await fetch('https://apitoolkit.pro/api/v1/regex', {
method: 'POST',
headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({ pattern: '\\d+', flags: 'g', input: 'abc 123 def 456' })
});
const { matches, count } = await res.json();