Regex Tester

All tools

Enter a regex pattern, flags, and input text. Toolinix will highlight matches and list them.

Common flags: g i m s u

Matches
0

One match per line.

Preview

        

Matches are highlighted.

What is a regular expression?

A regular expression (regex) is a pattern used to search, match, or extract parts of text.

This tool runs in your browser and helps you test patterns quickly without sending data to a server.

How to use the Regex Tester

  1. Enter your regex pattern (without surrounding slashes).
  2. Add flags like g (global), i (ignore case), or m (multiline).
  3. Paste your input text.
  4. See the matches list and highlighted preview.

Tips

  • Use g to find all matches, not just the first one.
  • Escape backslashes in some contexts (e.g. \d, \b).
  • If you get an error, the pattern may be invalid for JavaScript regex.

Regex checks before using a pattern in production

A pattern that matches one example may still reject valid input, accept invalid input, or become slow on adversarial text.

Positive and negative cases

Test representative matches, near misses, empty values, multiline input, Unicode text, and unusually long strings.

Flags and boundaries

Verify case, global, multiline, dot-all, anchors, word boundaries, and whether the pattern must match the full value.

Capture contract

Check numbered and named groups against the code that consumes them, especially after adding optional or nested groups.

Performance risk

Avoid ambiguous nested quantifiers and test failure cases for excessive backtracking before accepting untrusted input.

A practical example, an edge case, and a maintainer note

Practical example

Test ^[A-Z]{2}-\d{4}$ against both AB-1234 and AB-1234 followed by a newline; anchors can behave differently with multiline options.

Edge case

Nested quantifiers such as (a+)+ can cause catastrophic backtracking on a long near-match and freeze a production request.

Maintainer note

A small set of positive, negative, and worst-case samples is more useful than one expression that only passes the happy path.

Related tools

You may also find these tools useful.

Regex Tester FAQ

Does this tool support PCRE features?
It uses JavaScript regular expressions, so some PCRE features may not be available.
Are my regex and test text sent to a server?
No. Patterns run against your text with the browser's own RegExp engine — log excerpts you test against stay local.
Why do I only see one match?
Add the g flag to find all matches.