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.

Contact support@example.com or support@blinkcalc.com for help.

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

Forgetting to escape special characters.
Using greedy quantifiers when lazy matching is needed.
Missing anchors for full-string validation.
Assuming one regex perfectly validates all emails or URLs.
Forgetting the global flag when expecting multiple matches.
Misusing character classes.
Creating patterns that are slow on large input.
Not testing edge cases.

How to use this Regex Tester

  1. 1Enter a regex pattern.
  2. 2Choose flags such as global, ignore case, or multiline.
  3. 3Paste sample text into the test area.
  4. 4Review highlighted matches and capture groups.
  5. 5Copy the regex or match results if needed.

Why developers use a Regex Tester

Test patterns before adding them to code.
Debug form validation rules.
Extract values from logs or text.
Review capture groups clearly.
Compare flags and matching behaviour.
Avoid manual trial-and-error in production code.
Learn regex syntax with examples.

Regex Tester FAQs

It tests a regular expression against sample text and shows matches, flags, capture groups, and match details.