Regex Tester

Live pattern matching with highlighted matches and capture groups.

/ /
Flags: g (global) · i (case-insensitive) · m (multiline) · s (dotall) · u (unicode)

Regex Tester guide

The Regex Tester lets you test JavaScript regular expressions against sample text and see matches before using the pattern in code. It is a safer way to build patterns for validation, extraction, search-and-replace planning or log inspection.

Regular expressions can be powerful but easy to misread. Testing with realistic examples and edge cases helps avoid patterns that work only for the first happy-path string.

When to use it

How to use it

  1. Enter the regular expression pattern and flags supported by JavaScript.
  2. Paste realistic sample text with both matching and non-matching examples.
  3. Review highlighted matches and capture groups.
  4. Adjust anchors, character classes and quantifiers until the result is correct.
  5. Test edge cases before copying the pattern into production code.

Example

Input

Pattern: \b[A-Z]{2}-\d{4}\b, Text: Ticket DK-2026 is ready.

Output

Match: DK-2026

The word boundaries prevent partial matches inside longer strings.

Privacy

Patterns and test text stay in your browser. UtilityTools.eu does not receive the text you use for testing.

Limitations and accuracy notes

FAQ

Which regex flavor is this?

JavaScript / ECMAScript regex, matching what modern browsers support.

Why does my lookbehind fail?

Lookbehind support depends on the browser version and must follow JavaScript regex rules.

Should I validate email with one huge regex?

Usually no. Use practical checks plus confirmation emails for real account systems.