Regex Tester
Test regular expressions against sample text with live match highlighting.
Regex testing tool
Write, test, and debug regex patterns
Enter a pattern, choose JavaScript flags, paste sample text, and review matches and capture groups.
Paste text to test, for example: Contact support@example.com or support@blinkcalc.com.
2 matches found.
Highlighted match preview
Matches are highlighted as text spans, not rendered HTML.
Match status
Valid
2 matches found.
Match count
2
2 matches found.
Regex status
Valid
JavaScript RegExp syntax.
Active flags
gi
Enabled JavaScript regex flags.
Capture groups
0
Highest capture group count in one match.
First match index
8
Zero-based index in the test text.
Test text length
62
Characters in the sample text.
Replacement count
Off
Replacement uses JavaScript String.replace rules.
Copy regex pattern
Copy the current pattern and active flags for code, docs, or debugging notes.
Copy all matches
Copy match numbers, indexes, ranges, and matched values.
Copy replacement result
Copy the replacement preview when replacement mode is enabled.
Privacy note
Regex testing is designed to run locally in your browser without storing input.
Accuracy note
This tool uses JavaScript regex syntax, which can differ from PCRE, Python, Java, or .NET.
Performance note
Avoid unsafe or ambiguous patterns on very large or untrusted input.
Match details and capture groups
Inspect matched values, indexes, ranges, capture groups, and named groups.
Match #1
support@example.com
Start index 8, end index 27.
Match #2
support@blinkcalc.com
Start index 31, end index 52.
Practical regex examples
Click an example to populate the tester with a pattern, flags, and sample text.
Regex quick reference
`.`
Matches any character except newline unless dotAll is enabled.
`\d`
Digit character.
`\w`
Word character.
`\s`
Whitespace character.
`*`
Zero or more.
`+`
One or more.
`?`
Optional, or lazy modifier after a quantifier.
`{n,m}`
Repeated range.
`^`
Start of string or line with multiline.
`$`
End of string or line with multiline.
`[]`
Character class.
`()`
Capture group.
`(?: )`
Non-capturing group.
`|`
Alternation.
`\b`
Word boundary.
Developer guide
Test regex patterns before using them in code
A Regex Tester helps developers validate patterns, inspect edge cases, and understand capture groups before adding a regular expression to production code.
What is a Regex Tester?
A Regex Tester lets developers test a regular expression against sample text to see matches, captures, flags, and edge cases before using the pattern in code.
When should developers use one?
Use it for validating input patterns, extracting emails, URLs, dates, or numbers, debugging searches, testing form validation logic, working with logs, cleaning text, building replace operations, and learning syntax.
How regular expressions work
A regex pattern describes text to search for. Flags change matching behaviour, matches show where text is found, capture groups extract parts, anchors control position, and quantifiers control repetition.
JavaScript regex vs other engines
This tool uses JavaScript regular expression syntax. Regex syntax differs between JavaScript, PCRE, Python, Java, and .NET, so always test patterns in the target runtime.
Regex performance and safety
Some patterns can be expensive on large input, especially nested or ambiguous quantifiers. Keep production validation patterns simple and test edge cases.
Privacy
BlinkCalc is designed to test regex locally in the browser. Avoid pasting secrets, private logs, customer data, or sensitive documents unless you trust the environment.
Common regex mistakes
How to use this Regex Tester
- 1Enter a regex pattern.
- 2Choose flags such as global, ignore case, or multiline.
- 3Paste sample text into the test area.
- 4Review highlighted matches and capture groups.
- 5Copy the regex or match results if needed.
Why developers use a Regex Tester
Regex Tester FAQs
It tests a regular expression against sample text and shows matches, flags, capture groups, and match details.
Related tools