← Back to all tools

Browser-based Regex Tester

Regex Tester — Test, Debug, and Understand Regular Expressions

Test regular expressions in real time with match highlighting, group capture, and plain-English explanations.

Pattern

Evaluating… Runs in a worker with a 1-second evaluation limit and a separate 5-second startup limit. Pattern limit: 500 characters; text limit: 20,000.

Test Text

Contact us at support@example.com or sales@company.org for more info.
Matches0 matches found

Pattern Explanation

  • \b: a word boundary
  • (...): capture group
  • \w: a word character (a-z, A-Z, 0-9, _)
  • +: one or more times
  • "@": literal character
  • (...): capture group
  • \w: a word character (a-z, A-Z, 0-9, _)
  • +: one or more times
  • \.: a literal dot
  • \w: a word character (a-z, A-Z, 0-9, _)
  • +: one or more times
  • \b: a word boundary

Common Patterns

What Is a Regular Expression?

A regular expression (regex) is a sequence of characters that defines a search pattern. They're used for validation, search-and-replace operations, and parsing text in applications.

Regex patterns are supported in almost every programming language and text editor, making them an essential tool for developers. If you're working with JSON data, check out our JSON Formatter to clean and inspect your payloads.

Common Regex Patterns

PatternMatchesExample
^[\w.+-]+@[\w-]+\.[a-zA-Z]{2,}$Email addressuser@example.com
^\d{3}-\d{3}-\d{4}$US phone number555-123-4567
^https?:\/\/.+URLhttps://example.com

How to Use This Regex Tester

  1. Enter your regex pattern in the pattern input field
  2. Set any flags you need (global, case-insensitive, multiline, dotAll)
  3. Paste or type your test text in the test text area
  4. Review the highlighted matches and captured groups

Frequently asked questions

Should I paste /pattern/g or just the pattern?

Enter only the pattern body, such as \d+, and select flags using the controls. The tool passes the field directly to JavaScript's RegExp constructor; surrounding slash delimiters become part of the pattern instead of being parsed as literal syntax.

Why is only the first match shown?

Enable g to list repeated matches. Without g, the worker calls RegExp.exec once and shows only the first result. Output is capped at 1,000 matches and 100,000 captured characters, with a truncation notice. Expensive evaluations are stopped after one second rather than completing an unlimited scan.

Why does enabling multiline still not match across a newline?

The m flag changes how ^ and $ treat line boundaries. It does not make the dot match newlines; enable s for that. Test with a small input containing a newline to check the behavior you need.

Does a successful test prove the pattern works in another regex engine?

No. Matches come from your browser's JavaScript RegExp engine, with g, i, m and s controls. Other engines and runtime versions can differ. The explanation is a separate rule-based summary, so confirm complex patterns in the runtime that will use them.

Related Tools