Accueil Regex Tester

Regex Tester

Test regular expressions with flags (g, i, m) and see highlighted matches instantly — 100% in your browser.

Pattern & Test String

/ /

Matches

Matches
0
Matches will appear here...

What is a regular expression?

A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. Regex is used for pattern matching, validation, extraction and substitution in strings. It is supported by virtually every programming language, text editor and search tool.

Regex patterns can match simple literals (like hello), character classes (like [0-9] for digits), quantifiers (like * for zero or more), anchors (like ^ for start of string), groups (like (abc)), and much more. Mastering regex is a valuable skill for any developer.

Why use a regex tester?

Using a regex tester lets you experiment with patterns and see matches immediately. This is much faster than writing test code, running it and checking output. A live tester shows you exactly what your regex matches, helping you debug and refine patterns quickly.

Regex can be tricky — small changes in a pattern can produce very different results. A tester helps you verify that your pattern matches what you intend and nothing more. This is essential for input validation, log parsing, data extraction and search functionality.

Common regex patterns

Here are some common regex patterns and what they match:

  • \d+ — one or more digits
  • \w+ — one or more word characters (letters, digits, underscore)
  • [a-z]+ — one or more lowercase letters
  • ^[A-Za-z0-9]+$ — alphanumeric string (entire string)
  • \b\w+@\w+\.\w+\b — simple email pattern
  • https?:// — http or https
  • \d{4}-\d{2}-\d{2} — date in YYYY-MM-DD format
  • (\d{1,3}\.){3}\d{1,3} — IPv4 address

How to use the regex tester

Using this regex tester is simple:

  1. Enter your pattern. Type your regex in the pattern input field (without the surrounding slashes).
  2. Choose flags. Tick the g (global), i (case-insensitive) or m (multiline) checkboxes as needed.
  3. Enter test text. Paste or type the text you want to test against in the test text area.
  4. See matches. Matches are highlighted instantly in the results panel, with a match count displayed.

If your pattern is invalid, an error message explains the problem.

Regex flags explained

Regex flags modify how the pattern matches:

  • g (global) — finds all matches in the string, not just the first one. Without g, only the first match is returned.
  • i (case-insensitive) — makes the pattern match regardless of case. For example, /hello/i matches "Hello", "HELLO" and "hello".
  • m (multiline) — makes ^ and $ match the start and end of each line, not just the start and end of the entire string.

For complex patterns, consider using a regex visualizer or documentation like MDN's JavaScript RegExp reference. Regex is powerful but can be hard to read — always add comments explaining complex patterns in your code.

Is this regex tester free?

Yes, completely free with no sign-up, no limits beyond your device's memory, and no upload.

Which flags are supported?

The tester supports the three most common JavaScript RegExp flags: g (global), i (case-insensitive) and m (multiline).

Does it support capture groups?

The tester highlights full matches. Capture group contents are not displayed separately in this version, but the full match is shown for each occurrence.

Is my data uploaded?

No. All testing is local. Your regex patterns and test text never leave your browser.