Regex Tester
Test regular expressions against sample text using Python-style regex. View raw JSON results from the HeffTools Regex API and integrate the same endpoint into your own tools and automation.
Matches (JSON Output)
This is the raw JSON response returned by POST /api/v1/regex/test. It is suitable for use in
scripts, CI pipelines, and internal tools.
POST /api/v1/regex/test
How to Use the Regex Tester
- Enter a regex pattern in the Pattern field.
-
Optionally provide flags:
i– ignore case (case-insensitive matching)m– multiline (anchors^and$match line boundaries)s– dot matches newline (allows.to match line breaks)
- Paste the test text that you want to search or validate.
- Click Run to send the request to the HeffTools Regex API.
- Review the JSON output to see matches, groups, and any errors.
Example Patterns
\d+– one or more digits^#[0-9A-Fa-f]{6}$– hex color code like#1A2B3Chttps?://[^\s]+– simple HTTP/HTTPS URL matcher^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$– basic email validation pattern
Calling the Regex API from Your Code
This page uses the same JSON API you can use in your own automation:
POST /api/v1/regex/test
Content-Type: application/json
{
"pattern": "\\d+",
"text": "Order 1234 shipped on 2024-01-01",
"flags": "s"
}
Example JSON response (shape may vary):
{
"flags": "s",
"match_count": 4,
"matches": [
{
"end": 10,
"groups": [],
"match": "1234",
"start": 6
},
{
"end": 26,
"groups": [],
"match": "2024",
"start": 22
},
{
"end": 29,
"groups": [],
"match": "01",
"start": 27
},
{
"end": 32,
"groups": [],
"match": "01",
"start": 30
}
],
"pattern": "\\d+"
}
Related Tools
URL Encode / Decode · Base64 Encoder / Decoder · JSON / YAML / CSV Converter