Regex Tester is a comprehensive tool for testing and validating regular expressions. It supports multiple operations (test, match, search, replace, split) with detailed performance analysis and pattern suggestions.
Try it — live request, no key required
No key required to try it. Get a key to use it in your app.
{
"status": "ok",
"error": null,
"data": {
// Regex Tester response payload
}
}
About the Regex Tester API
Regex Tester works by testing regular expressions against text and providing detailed results including matches, pattern analysis, performance metrics, and common pattern examples. Supports all standard regex flags and operations.
What people use it for
- Pattern Development
- Test and debug regex patterns before implementing them in production code to ensure correct matching
- Data Validation
- Validate regex patterns for input validation in forms, APIs, and data processing pipelines
- Text Processing
- Test regex patterns for text extraction, replacement, and parsing operations
- Learning Tool
- Learn regex syntax with detailed guides, common pattern examples, and real-time testing feedback
Ways to call it
One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.
- JSON
- Default REST response
- XML
- Markup format
- YAML
- Human-readable
- CSV
- Tabular export
- GraphQL
- Query language
- MCP
- For AI agents
Other ways to use Regex Tester
Same data, same APIVerve account, same credit balance — one key works on all of them.
What does the Regex Tester API do?
How do I authenticate Regex Tester API requests?
How much does the Regex Tester API cost?
How fast is the Regex Tester API?
What response formats does the Regex Tester API support?
What HTTP method does the Regex Tester API use?
Request parameters — POST /v1/regextester
Sent as JSON in the request body. Premium parameters are accepted on every plan but only take effect on plans that include them. Anything not listed here is dropped rather than passed through.
Required
| Parameter | Type | Example | Description |
|---|---|---|---|
patternRequired | string | \d{3}-\d{2}-\d{4} | The regular expression pattern to test |
textRequired | string | My SSN is 123-45-6789 | The text to test the pattern against |
Optional
| Parameter | Type | Example | Description |
|---|---|---|---|
flagsOptional | string | gi | Regex flags: g (global), i (case insensitive), m (multiline), s (dotall), u (unicode), y (sticky) |
test_typeOptional | string | match | Operation typetestmatchsearchreplacesplitdefault test |
replacementOptional | string | [REDACTED] | Replacement text for 'replace' operation |
curl -X POST "https://api.apiverve.com/v1/regextester" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"pattern":"\\d{3}-\\d{2}-\\d{4}","text":"My SSN is 123-45-6789 and my friend'\''s is 987-65-4321","flags":"g","test_type":"value","replacement":"value"}'Authentication
Send your key in the x-api-key header. That is the only auth step — no token exchange, and no per-endpoint scope to configure.
| Header | When | Value |
|---|---|---|
x-api-keyRequired | Every request | Your API key. Header names are case-insensitive, so X-API-Key is the same header. |
AuthorizationAlternate | Instead of the above | Bearer <key> — for clients that only expose bearer auth. Resolves to the same account and the same billing. |
content-typeRequired | POST body | application/json |
A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.
Response — POST /v1/regextester
Every APIVerve endpoint returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape.
{
"status": "ok",
"error": null,
"data": {
"pattern": "\\d{3}-\\d{2}-\\d{4}",
"text": "My SSN is 123-45-6789 and my friend's is 987-65-4321",
"flags": "g",
"test_type": "test",
"replacement": null,
"is_valid_regex": true,
"regex_info": {
"pattern": "\\d{3}-\\d{2}-\\d{4}",
"flags": {
"global": true,
"ignore_case": false,
"multiline": false,
"sticky": false,
"unicode": false,
"dot_all": false
},
"source": "\\d{3}-\\d{2}-\\d{4}",
"last_index": 21,
"pattern_length": 17,
"complexity": "Medium"
},
"test_results": {
"operation": "test",
"result": true,
"execution_time_ms": 0,
"description": "Returns true if pattern matches anywhere in text, false otherwise"
},
"performance": {
"iterations": 192,
"total_time_ms": 0,
"average_time_ms": 0,
"performance_rating": "Excellent"
},
"pattern_analysis": {
"contains_anchors": {
"start_anchor": false,
"end_anchor": false,
"word_boundary": false
},
"contains_quantifiers": {
"zero_or_more": false,
"one_or_more": false,
"zero_or_one": false,
"specific_count": true,
"range_count": false
},
"contains_groups": {
"capturing_groups": 0,
"non_capturing_groups": 0,
"named_groups": 0
},
"contains_character_classes": {
"predefined_classes": true,
"custom_classes": false,
"negated_classes": false
},
"contains_special_chars": {
"wildcard": false,
"pipe": false,
"escape_sequences": 3
}
},
"suggestions": [
"Consider anchoring with ^ or $ if you need exact matches"
],
"common_patterns": [
{
"name": "Email Address",
"pattern": "^[\\w\\.-]+@[\\w\\.-]+\\.[a-zA-Z]{2,}$",
"description": "Matches valid email addresses",
"example": "user@example.com"
},
{
"name": "Phone Number (US)",
"pattern": "^\\(?(\\d{3})\\)?[-.\\s]?(\\d{3})[-.\\s]?(\\d{4})$",
"description": "Matches US phone numbers in various formats",
"example": "(123) 456-7890"
},
{
"name": "URL",
"pattern": "^https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$",
"description": "Matches HTTP and HTTPS URLs",
"example": "https://www.example.com"
},
{
"name": "IP Address (IPv4)",
"pattern": "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$",
"description": "Matches valid IPv4 addresses",
"example": "192.168.1.1"
},
{
"name": "Credit Card Number",
"pattern": "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|3[0-9]{13}|6(?:011|5[0-9]{2})[0-9]{12})$",
"description": "Matches major credit card formats",
"example": "4532123456789012"
},
{
"name": "Social Security Number",
"pattern": "^\\d{3}-?\\d{2}-?\\d{4}$",
"description": "Matches SSN with or without dashes",
"example": "123-45-6789"
},
{
"name": "Date (MM/DD/YYYY)",
"pattern": "^(0[1-9]|1[0-2])\\/(0[1-9]|[12][0-9]|3[01])\\/(19|20)\\d{2}$",
"description": "Matches MM/DD/YYYY date format",
"example": "12/31/2023"
},
{
"name": "Time (24-hour)",
"pattern": "^([01]?[0-9]|2[0-3]):[0-5][0-9]$",
"description": "Matches 24-hour time format",
"example": "14:30"
},
{
"name": "Hexadecimal Color",
"pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$",
"description": "Matches hex color codes",
"example": "#FF5733"
},
{
"name": "Strong Password",
"pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$",
"description": "At least 8 chars with uppercase, lowercase, digit, and special char",
"example": "MyP@ssw0rd"
}
],
"regex_guide": {
"basic_syntax": [
{
"symbol": ".",
"description": "Matches any single character except newline"
},
{
"symbol": "*",
"description": "Matches 0 or more of the preceding character"
},
{
"symbol": "+",
"description": "Matches 1 or more of the preceding character"
},
{
"symbol": "?",
"description": "Matches 0 or 1 of the preceding character"
},
{
"symbol": "^",
"description": "Matches start of string"
},
{
"symbol": "$",
"description": "Matches end of string"
},
{
"symbol": "|",
"description": "OR operator"
},
{
"symbol": "\\",
"description": "Escape character"
}
],
"character_classes": [
{
"symbol": "[abc]",
"description": "Matches any character in the set"
},
{
"symbol": "[^abc]",
"description": "Matches any character NOT in the set"
},
{
"symbol": "[a-z]",
"description": "Matches any lowercase letter"
},
{
"symbol": "[A-Z]",
"description": "Matches any uppercase letter"
},
{
"symbol": "[0-9]",
"description": "Matches any digit"
},
{
"symbol": "\\d",
"description": "Matches any digit (equivalent to [0-9])"
},
{
"symbol": "\\w",
"description": "Matches any word character [a-zA-Z0-9_]"
},
{
"symbol": "\\s",
"description": "Matches any whitespace character"
}
],
"quantifiers": [
{
"symbol": "{n}",
"description": "Matches exactly n times"
},
{
"symbol": "{n,}",
"description": "Matches n or more times"
},
{
"symbol": "{n,m}",
"description": "Matches between n and m times"
},
{
"symbol": "*?",
"description": "Non-greedy: matches 0 or more (lazy)"
},
{
"symbol": "+?",
"description": "Non-greedy: matches 1 or more (lazy)"
},
{
"symbol": "??",
"description": "Non-greedy: matches 0 or 1 (lazy)"
}
],
"groups": [
{
"symbol": "(abc)",
"description": "Capturing group"
},
{
"symbol": "(?:abc)",
"description": "Non-capturing group"
},
{
"symbol": "(?<name>abc)",
"description": "Named capturing group"
},
{
"symbol": "(?=abc)",
"description": "Positive lookahead"
},
{
"symbol": "(?!abc)",
"description": "Negative lookahead"
},
{
"symbol": "(?<=abc)",
"description": "Positive lookbehind"
},
{
"symbol": "(?<!abc)",
"description": "Negative lookbehind"
}
],
"flags": [
{
"flag": "g",
"description": "Global - find all matches"
},
{
"flag": "i",
"description": "Case insensitive"
},
{
"flag": "m",
"description": "Multiline - ^ and $ match line breaks"
},
{
"flag": "s",
"description": "Dot matches newline characters"
},
{
"flag": "u",
"description": "Unicode mode"
},
{
"flag": "y",
"description": "Sticky - matches from lastIndex position"
}
]
}
}
}
Response fields
Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.
| Field | Type | Example | Description |
|---|---|---|---|
pattern | string | "\d{3}-\d{2}-\d{4}" | The regular expression pattern that was tested |
text | string | "My SSN is 123-45-6789 and my friend's is 987-65-4321" | The input text the pattern was tested against |
flags | string | "g" | The regex flags that were applied (g, i, m, s, u, y) |
test_type | string | "test" | The operation that was run: test, match, search, replace, or split |
replacement | object | null | The replacement text supplied for a replace operation, or null when not applicable |
is_valid_regex | boolean | true | Whether the supplied pattern compiled into a valid regular expression |
regex_info | object | {...} | Details about the compiled regex, including its flags, source, and a computed complexity rating |
pattern | string | "\d{3}-\d{2}-\d{4}" | The regular expression pattern that was tested |
flags | object | {...} | The regex flags that were applied (g, i, m, s, u, y) |
global | boolean | true | |
ignore_case | boolean | false | |
multiline | boolean | false | |
sticky | boolean | false | |
unicode | boolean | false | |
dot_all | boolean | false | |
source | string | "\d{3}-\d{2}-\d{4}" | |
last_index | number | 21 | |
pattern_length | number | 17 | |
complexity | string | "Medium" | |
test_results | object | {...} | |
operation | string | "test" | The operation that was actually run against the text |
result | boolean | true | Whether the pattern matched anywhere in the text; returned when test_type is 'test' |
execution_time_ms | number | 0 | How long the regex operation took to execute, in milliseconds |
description | string | "Returns true if pattern matches anywhere in text, false otherwise" | Human-readable explanation of what the operation's result means |
performancePremium | object | {...} | Performance metrics from re-running the pattern many times to measure its average execution speed |
iterationsPremium | number | 192 | |
total_time_msPremium | number | 0 | |
average_time_msPremium | number | 0 | |
performance_ratingPremium | string | "Excellent" | |
pattern_analysis | object | {...} | Structural analysis of the pattern: which anchors, quantifiers, groups, character classes, and special characters it uses |
contains_anchors | object | {...} | |
start_anchor | boolean | false | |
end_anchor | boolean | false | |
word_boundary | boolean | false | |
contains_quantifiers | object | {...} | |
zero_or_more | boolean | false | |
one_or_more | boolean | false | |
zero_or_one | boolean | false | |
specific_count | boolean | true | |
range_count | boolean | false | |
contains_groups | object | {...} | |
capturing_groups | number | 0 | |
non_capturing_groups | number | 0 | |
named_groups | number | 0 | |
contains_character_classes | object | {...} | |
predefined_classes | boolean | true | |
custom_classes | boolean | false | |
negated_classes | boolean | false | |
contains_special_chars | object | {...} | |
wildcard | boolean | false | |
pipe | boolean | false | |
escape_sequences | number | 3 | |
suggestions | array | [Consider anchoring with ^ or $ if you need exact matches] | Suggestions for fixing an invalid pattern, or optimization tips for a valid one |
common_patterns | array[10] | Reference library of common regex patterns (email, phone, URL, and similar) for comparison | |
name | string | "Email Address" | |
pattern | string | "^[\w\.-]+@[\w\.-]+\.[a-zA-Z]{2,}$" | The regular expression pattern that was tested |
description | string | "Matches valid email addresses" | |
example | string | "user@example.com" | |
regex_guide | object | {...} | Reference guide to regex syntax covering basic syntax, character classes, quantifiers, groups, and flags |
basic_syntax | array[8] | ||
symbol | string | "." | |
description | string | "Matches any single character except newline" | |
character_classes | array[8] | ||
symbol | string | "[abc]" | |
description | string | "Matches any character in the set" | |
quantifiers | array[6] | ||
symbol | string | "{n}" | |
description | string | "Matches exactly n times" | |
groups | array[7] | ||
symbol | string | "(abc)" | |
description | string | "Capturing group" | |
flags | array[6] | The regex flags that were applied (g, i, m, s, u, y) | |
flag | string | "g" | |
description | string | "Global - find all matches" |
Response headers
Every response carries your balance, so your own code always knows where it stands without polling anything. All four are exposed to browsers through CORS.
| Header | What it carries |
|---|---|
x-api-remaining-credits | Credits left in the current cycle |
x-api-credits-used | Credits spent in the current cycle |
x-api-max-credits | The allowance for the cycle |
x-api-version | Version of the endpoint that answered |
Errors
Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change.
| Status | Meaning | What to do |
|---|---|---|
400 | Input was rejected | Read error; it names the parameter that has to change. |
401 | Key missing or invalid | Check the header name and the key value. |
403 | Key valid, but not permitted here | A key restriction or an IP allow-list — never a bad key. |
429 | Rate limited, or out of credits | Read error to tell them apart, then back off or top up. |
What a call costs — 2 credits per call
Credits are shared across every APIVerve API — one balance, one key, one bill. Failed requests never count against it, so a rejected input costs nothing.
| Plan | Per month | Credits | Regex Tester calls | Per 1,000 calls |
|---|---|---|---|---|
| Free | Free | 200 | 100 | Free |
| Starter | $29.99 | 200,000 | 100,000 | $0.30 |
| Pro | $99.99 | 1,000,000 | 500,000 | $0.20 |
| Mega | $299.99 | 4,000,000 | 2,000,000 | $0.15 |
Calls are what the credits buy at this API's rate — spend them here, on any of the other APIs, or across both. Nothing is reserved per endpoint.
Call it from cURL — POST /v1/regextester
No SDK to install — this is a plain HTTPS call to /v1/regextester with your key in the x-api-key header. Swap in a real key and it runs as-is.
curl "https://api.apiverve.com/v1/regextester" \
-H "x-api-key: YOUR_API_KEY"Resources
Also published for
Only the languages APIVerve ships a client for are listed — the rest call the endpoint directly over HTTPS.
Call it from Node.js — POST /v1/regextester
Install the Node.js SDK, then call the Regex Tester API with your key. The client wraps the same HTTPS request, so anything it returns is what the endpoint returns.
npm install @apiverve/regextesterconst res = await fetch("https://api.apiverve.com/v1/regextester", {
headers: { "x-api-key": "YOUR_API_KEY" },
});
const { data } = await res.json();
console.log(data);Resources
Also published for
Only the languages APIVerve ships a client for are listed — the rest call the endpoint directly over HTTPS.
Call it from Python — POST /v1/regextester
Install the Python SDK, then call the Regex Tester API with your key. The client wraps the same HTTPS request, so anything it returns is what the endpoint returns.
pip install apiverve-regextesterimport requests
res = requests.get(
"https://api.apiverve.com/v1/regextester",
headers={"x-api-key": "YOUR_API_KEY"},
)
print(res.json()["data"])Resources
Also published for
Only the languages APIVerve ships a client for are listed — the rest call the endpoint directly over HTTPS.
Call it from C# / .NET — POST /v1/regextester
Install the C# / .NET SDK, then call the Regex Tester API with your key. The client wraps the same HTTPS request, so anything it returns is what the endpoint returns.
dotnet add package APIVerve.API.RegexTesterusing var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
var json = await client.GetStringAsync("https://api.apiverve.com/v1/regextester");
Console.WriteLine(json);Resources
Also published for
Only the languages APIVerve ships a client for are listed — the rest call the endpoint directly over HTTPS.
Call it from Go — POST /v1/regextester
No SDK to install — this is a plain HTTPS call to /v1/regextester with your key in the x-api-key header. Swap in a real key and it runs as-is.
req, _ := http.NewRequest("GET", "https://api.apiverve.com/v1/regextester", nil)
req.Header.Set("x-api-key", "YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))Resources
Also published for
Only the languages APIVerve ships a client for are listed — the rest call the endpoint directly over HTTPS.
Call it from PHP — POST /v1/regextester
No SDK to install — this is a plain HTTPS call to /v1/regextester with your key in the x-api-key header. Swap in a real key and it runs as-is.
$ch = curl_init("https://api.apiverve.com/v1/regextester");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-api-key: YOUR_API_KEY"]);
$response = curl_exec($ch);
echo $response;Resources
Also published for
Only the languages APIVerve ships a client for are listed — the rest call the endpoint directly over HTTPS.
Call it from Ruby — POST /v1/regextester
No SDK to install — this is a plain HTTPS call to /v1/regextester with your key in the x-api-key header. Swap in a real key and it runs as-is.
require "net/http"
uri = URI("https://api.apiverve.com/v1/regextester")
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = "YOUR_API_KEY"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
puts res.bodyResources
Also published for
Only the languages APIVerve ships a client for are listed — the rest call the endpoint directly over HTTPS.
Zero-code embed — one snippet, no backend
Drop an interactive Regex Tester form onto any page. The widget calls the API for you, so no key ever appears in your markup and there is nothing to deploy.
Changelog — Regex Tester API
Every change to this endpoint, newest first. Breaking changes ship as a new version and the previous one keeps serving — response fields are added, never removed or retyped in place, so an integration written against v1 keeps working.
Entries are picked up from dated catalog snapshots, so the first one appears after the next snapshot that moves something. A period where nothing changed produces no entry — silence is a valid changelog for the Regex Tester API.
Text Processing
- Acronym Expander
- Anagram Detector
- Antonym Finder
- Cron Expression Parser
- Data Masking
- Did You Mean
- Emoji Decorator
- Gibberish Detector
- Grammar Check
- ISBN Validator
- JSON Schema Validator
- Keyword Extractor
- Leet Speak
- Levenshtein Distance
- Line Sorter
- Markdown Link Extractor
- Palindrome Checker
- Parts Of Speech
- Phonetic Encoder
- Pig Latin
- Profanity Filter
- Reading Time Calculator
- Regex Tester
- Remove Punctuation
- Reverse Text
- Rhyming Words
- Slugify
- Spell Checker
- Syllable Counter
- Tax ID Validator
- Tense Converter
- Text Language
- Text Lemmatizer
- Text Readability Score
- Text Similarity
- Text Styler
- Text Summarizer
- Text to Emoji
- Title Case Converter
- Translator
- Vowel Counter
- Website Readability
- Word Lexicon Analyzer
- Word Opposites
- Word Pronunciation
Related articles
All articles →
Take Your App Multilingual (No Rewrite)Add language support to an existing app without rearchitecting. Practical strategies for translation, detection, and localization.Read
Summarize Text with AI: A Practical GuideUse AI to summarize articles, documents, and user content. Tutorial with code for content platforms, research tools, and dashboards.Read
7 Content Moderation Mistakes That Sink AppsYour app allows user content. Here are the moderation mistakes that get apps pulled from stores.Read